Hi,
We are upgrading to Gradle 8.0. We have the Jacoco plugin configured for a multi module project. We aggregate and validate the merged code coverage results.
In Gradle 7.x we use the jacocoMerge task but that task has been removed.
We follow the setup described on this page:
https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_code_coverage_standalone.html
We configure the root project to perform the aggregation:
plugins {
id base
id 'jacoco-report-aggregation'
}
dependencies {
subprojects.forEach {
jacocoAggregation it
}
}
reporting {
reports {
testCodeCoverageReport(JacocoCoverageReport) {
testType = TestSuiteType.UNIT_TEST
}
integrationTestCodeCoverageReport(JacocoCoverageReport) {
testType = TestSuiteType.INTEGRATION_TEST
}
}
}
tasks.named('check') {
dependsOn tasks.named('testCodeCoverageReport', JacocoReport)
dependsOn tasks.named('integrationTestCodeCoverageReport', JacocoReport)
}
When executing the task integrationTestAggregateTestReport
, the task is skipped with the following message:
Skipping task ‘:integrationTestAggregateTestReport’ as it has no source files and no previous output files.
The documentation for the jaCoCo Report Aggregation Plugin (The JaCoCo Report Aggregation Plugin) states:
Example 2 could also be used to aggregate results via the root project.
What am I missing?
And once the aggregation is working, is it possible to validate and fail the build on the aggregation of all the test suites?
Kind regards,
Bart