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

infra: Fix jvm coverage report #12694

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

Conversation

arthurscchan
Copy link
Contributor

@arthurscchan arthurscchan commented Nov 6, 2024

The current JVM coverage calculation includes all class files and JAR files in $OUT. If the project has copied necessary dependency JAR files to $OUT for fuzzing purposes, those classes will also be included in the JaCoCo coverage report, adding noise. This PR addresses that issue by only copying class files located in the $OUT/$SRC directory, which are lively compiled from the project source code, ensuring that only project classes are used by jacoco-cli to generate the coverage report. As all JVM languages compile to class files, this approach should work for all JVM languages supported by OSS-Fuzz in general.

@DavidKorczynski DavidKorczynski marked this pull request as ready for review November 13, 2024 22:15
@DavidKorczynski
Copy link
Collaborator

/gcbrun trial_build.py jvm --fuzzing-engines libfuzzer --sanitizers coverage

classes_dir=$DUMPS_DIR/classes
mkdir $classes_dir
for fuzz_target in $FUZZ_TARGETS; do
# Continue if not a fuzz target.
if [[ $FUZZING_ENGINE != "none" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete if [[ $FUZZING_ENGINE != "none" ]]; then? We don't need this logic still?

@DavidKorczynski
Copy link
Collaborator

/gcbrun trial_build.py jvm --fuzzing-engines libfuzzer --sanitizers coverage

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.

2 participants