-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Hi and sorry to create an issue, since it's more of a question than a proper issue, but how do you aggregate coverage when you have different test tasks?
I have a multi-project build.
Say I have two test tasks: test
and integrationTest
Then I have (as you said): reportTestScoverage
and reportIntegrationTestScoverage
=> perfect.
I tried aggregateScoverage
: it's running both the test
and integrationTest
tasks, perfect.
But I'd need to have two different aggregateScoverage
tasks, one for each test task.
I tried first:
create<org.scoverage.ScoverageAggregate>("testCoverage") {
dependsOn("reportTestScoverage")
}
But it failed saying many properties were missing.
Thus I tried:
create<org.scoverage.ScoverageAggregate>("testCoverage") {
dependsOn("reportTestScoverage")
coverageOutputCobertura.set(true)
coverageOutputHTML.set(true)
coverageOutputXML.set(true)
deleteReportsOnAggregation.set(false)
coverageDebug.set(false)
reportDir.set(rootProject.buildDir.resolve("reports"))
}
But this failed because ScoverageAggregate.runner
is null.
So I finally got it working through:
create<org.scoverage.ScoverageAggregate>("testCoverage") {
dependsOn("reportTestScoverage")
coverageOutputCobertura.set(true)
coverageOutputHTML.set(true)
coverageOutputXML.set(true)
deleteReportsOnAggregation.set(false)
coverageDebug.set(false)
reportDir.set(rootProject.buildDir.resolve("reports"))
runner = ScoverageRunner(project.configurations.scoverage.get())
}
But it doesn't work, it only creates scoverage for the last subProject it builded.
Do you have any pointer? Thank you!