-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Java-coverage: Add logic to exclude dependencies in JVM coverage report #10860
Conversation
880cf34
to
22108da
Compare
63e07c3
to
9e61819
Compare
Signed-off-by: Arthur Chan <[email protected]>
Signed-off-by: Arthur Chan <[email protected]>
7dfed98
to
39d59c8
Compare
I'll review this tomorrow! |
It is found that it maybe better to do this per project by separating the dependencies jar and project code jar to avoid Jacoco generating the reports for those dependencies jar. Currnetly, Jacoco only generate reports on all jar existing in the $OUT directory. Putting dependencies in inner directory like $OUT/dependency will exclude them from Jacoco report which is an alternatives. Thus closing this PR. |
…included in coverage report Introduce two jar-files to separate .class files into two jar files, one which is included in coverage reporting and one which contains libraries which should not appear in the coverage report. Unfortunately this only allows control on "artifact" level, which means single uninteresting classes/packages cannot be excluded. Related to google#10826 and google#10860 (cherry picked from commit 2b48e656646d4c3aa61ea44b5b3edef59942f142)
…eptions (#11418) As a general solution for handling excluding classes from JaCoCo coverage counting was not merged (See #10860#issuecomment-1870891873 ), this PR tries to implement a different approach which separates the class-files into two jar-files and this way at least allows to exclude code of third-party libraries when reporting coverage of fuzzing. Also add two expected exceptions and adjust one limit to match the amount of memory which oss-fuzz uses here.
This PR resolves #10826 by using the COVERAGE_EXTRA_ARGS from project.yaml or helper.py script to retrieve a TARGET_PACKAGE_PREFIX list to specify what class packages to be included in the Jacoco HTML report for JVM projects.
Sample result for project Joni before the PR
Sample result after the PR is applied
The additional field added to project.yaml
coverage_extra_args: TARGET_PACKAGE_PREFIX=org.joni.*