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

build: DH-18477: Java coverage generated conditionally #6586

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stanbrub
Copy link
Contributor

@stanbrub stanbrub commented Jan 22, 2025

Java coverage in the DHC build with Jacoco was broken at some point. Fixed that and added coverage merge. Full coverage can be run and merged with the following:

./gradlew -Pcoverage.enabled=true check
./gradlew -Pcoverage.enabled=true testSerial
./gradlew -Pcoverage.enabled=true testParallel
./gradlew -Pcoverage.enabled=true testOutOfBand
./gradlew -Pcoverage.enabled=true coverage
./gradlew -Pcoverage.enabled=true coverage-merge

This produces HTML, CSV, XML coverage artifacts at the Java project level. It also produces a merged HTML site in the root "build/reports" directory.

If the "coverage.enabled" property is not supplied or is false, "check" will run as usual without instrumentation.

Jira: https://deephaven.atlassian.net/browse/DH-18477

@stanbrub stanbrub self-assigned this Jan 22, 2025
@stanbrub stanbrub requested a review from devinrsmith January 22, 2025 00:21
Comment on lines +5 to +6
// Apply Jacoco instrumentation and coverage reporting
if (project.findProperty('coverage.enabled') == 'true') {
Copy link
Member

Choose a reason for hiding this comment

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

@niloc132; I wonder if we should unconditionally apply the jacoco plugin.

Copy link
Contributor Author

@stanbrub stanbrub Jan 24, 2025

Choose a reason for hiding this comment

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

Would that affect things like JMH because of instrumentation?

jacoco {
destinationFile = layout.buildDirectory.file('jacoco/jacoco.exec').get().asFile
}
finalizedBy jacocoTestReport
}

jacocoTestReport {
Copy link
Member

Choose a reason for hiding this comment

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

We may need to look into hooking up integration tests as part of the coverage path. Right now, it seems like only the "test" task is included for the reporting. https://docs.gradle.org/current/userguide/jacoco_plugin.html#sec:jacoco_tasks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the README.md I have the expected command line for running everything. Are there more than check, testSerial, testParallel, testOutOfBand? How to I run anything that's missing?

@stanbrub stanbrub changed the title build: DH-18477: Java coverage is now generated conditionally build: DH-18477: Java coverage generated conditionally Jan 22, 2025
@stanbrub stanbrub requested a review from devinrsmith January 24, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants