Setup code coverage correctly in 8.0 for multi module project

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

Maybe hard to say what you are missing as your information also do not fit. You talk about integrationTestAggregateTestReport, but from your example code it should be integrationTestCodeCoverageReport, shouldn’t it?

Maybe if you could create an MCVE it would be clearer.

Regarding the overall report, as far as I remember there is no support for it built in, but you should be able to do it manually.
The test suite type is one of the attribues on the outgoing configuration.
The plugin then uses a lenient artifact view to get that configuration for all specified projects if it exists and feeds that as input to the report task.
You could most probably create multiple artifact views for the different types, and give them combined to a report task as inputs, but I didn’t try that yet.