Jacoco-report-aggregation with multiple TestTypes

I am already using the still incubating jacoco-report-aggregation (as well as the test-report-aggregation) which are both based on the jvm-test-suite and it works quite nice.
I do have some sub-projects with an additional test-suite (integrationTest), which works as well.

Now I would like to aggregate not only the projects but also the testTypes into one report (at least the jacoco one). Can this be done? If so, how?

Currently does not seem possible, see Allow Jacoco Aggregate plugin to create aggregated/merged report with multiple test suites · Issue #23223 · gradle/gradle · GitHub

To be correct, there is no built-in way in that plugin to do it.
But I think it should be achievable through manual configuration.
You probably need one configuration per test-type through which you request the needed data and then just feed all of them to one JacocoReport task.

You can probably also configure the reports per test-type using the aggregation plugin, thereby getting the necessary configurations created and configured through the plugin already and then just need to create a custom JacocoReport task where you feed the data in.

Thanks, Vampire, it appears to be the case that both your solution ideas are now covered with example implementations by the GitHub ticket I linked.

1 Like