Question related to Test Report Aggregation Plugin

Hello There,

I have a single module project with multiple test suites for different types of tests. Is it possible to aggregate all HTML test reports into a single HTML report using the test-report-aggregation-plugin?

For me it looks like the plugin is only helpful for having a multi project build. That means aggregating reports of multiple subprojects.

Or could this be accomplished with gradle on-board mechanisms?

Thanks,
Sebastian

Okay as so often I found the solution after posting the question.

val aggregateUnitAndComponentTestReports by tasks.registering(TestReport::class) {
    destinationDirectory = file(layout.buildDirectory.dir("reports/aggregated-tests"))
    testResults.from(tasks.named("test"), tasks.named("componentTest"))
}

Maybe this helps another gradle user.

Cheers

1 Like