diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy index 225201a5c0d8..a592fa0656e1 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy @@ -1387,8 +1387,14 @@ class BeamModulePlugin implements Plugin { getSourceDirectories().setFrom( project.files(project.sourceSets.main.allSource.srcDirs) ) - getExecutionData().setFrom(project.file( - project.getLayout().getBuildDirectory().file("jacoco/test.exec") + // Collect execution data from every Test task that ran in this module + // (e.g. test, needsRunnerTests, validatesRunner) instead of only + // build/jacoco/test.exec, so coverage from runner-based test tasks is + // no longer dropped from the report. + // See https://github.com/apache/beam/issues/18194. + getExecutionData().setFrom(project.fileTree( + dir: project.getLayout().getBuildDirectory().dir("jacoco"), + include: ['*.exec'] )) reports { html.required = true