Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve jacoco parsing and improve kotlin support #1280

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jasongilanfarr
Copy link

@jasongilanfarr jasongilanfarr commented Jan 27, 2025

Fixes #1279

The jacoco parser made some relatively safe assumptions about the jacoco report, except when jacoco is used to instrument kotlin. Kotlin doesn't have the same restrictions as java when it comes to top level classes, so the report parsing will just immediately error out.

This improves the parser by making it sourcefilename centric instead of class centric (falling back on the pattern of top level class + .java == sourcefilename if the sourcefilename is missing).

In addition, when aggregated across multiple projects, the report commonly doesn't have the full relative paths, so we need to be able to find both java and kotlin files. There is also an assumption that a fully qualified class can only exist in one location and it would panic; however, this isn't entirely uncommon, so don't panic, but instead, inform the user that its not fully supported.

The jacoco parser made some relatively safe assumptions about the jacoco
report, except when jacoco is used to instrument kotlin. Kotlin doesn't
have the same restrictions as java when it comes to top level classes,
so the report parsing will just immediately error out.

This improves the parser by making it sourcefilename centric instead of
class centric (falling back on the pattern of top level class + .java ==
sourcefilename if the sourcefilename is missing).

In addition, when aggregated across multiple projects, the report
commonly doesn't have the full relative paths, so we need to be able to
find _both_ java and kotlin files. There is also an assumption that a
fully qualified class can only exist in one location and it would panic;
however, this isn't _entirely_ uncommon, so don't panic, but instead,
inform the user that its not fully supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jacoco parsing reports from kotlin
1 participant