[#18194] Include all per-module JaCoCo execution data in jacocoTestReport - #39819
Open
ulofiai wants to merge 1 commit into
Open
[#18194] Include all per-module JaCoCo execution data in jacocoTestReport#39819ulofiai wants to merge 1 commit into
ulofiai wants to merge 1 commit into
Conversation
The shared jacocoTestReport configuration hard-coded its execution data to build/jacoco/test.exec, so coverage recorded by other Test tasks in the same module (e.g. needsRunnerTests and validatesRunner in runners/direct-java, which run the sdks/java/core runner-based suites) was silently dropped, under-reporting coverage. Use a fileTree over build/jacoco/*.exec so execution data from every Test task that ran in the module is included in the report. Fixes apache#18194 Signed-off-by: ulofiai <monsterking@tutamail.com>
Contributor
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Author
|
assign set of reviewers |
Contributor
|
Assigning reviewers: R: @Abacn for label build. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18194.
The shared
jacocoTestReportconfiguration inBeamModulePluginhard-codes its execution data tobuild/jacoco/test.exec. Any otherTesttask that runs in a module writes its JaCoCo execution data tobuild/jacoco/<taskName>.exec(Gradle default), and that data was silently excluded from the report. In particular,runners/direct-java'sneedsRunnerTestsandvalidatesRunnertasks execute thesdks/java/coreNeedsRunner/ValidatesRunnersuites, and none of that coverage was counted — the under-reporting described in the issue (the bulk of the SDK is tested via the DirectRunner).This change sets the report's execution data to a
fileTreeoverbuild/jacoco/*.exec, so execution data from everyTesttask that actually ran in the module is aggregated. AfileTreeis also more robust than a hard-coded file reference when a given exec file does not exist (the report task is skipped as NO-SOURCE instead of failing). Report class directories, source directories, excludes, and the CI upload path (**/build/jacoco/report/**) are unchanged.