How to create one consolidated test report for several 'testResultsDir's


(thomas.glaeser) #1

I understand that a consolidated test report for a multi-project build can be achieved by setting …

// Consolidate test report at the root-project level
testResultsDirName
= "$rootProject.buildDir/test-results"
testReportDirName
 = "$rootProject.buildDir/reports/tests"

But for a legacy build we have tests with the same name which we therefore split into different directories in order to avoid getting them overwritten …

// Consolidate test report at the root-project level
testResultsDirName
= "$rootProject.buildDir/test-results/$foo"

Now, how can I tell Gradle to consider ‘testResultsDir’ and its sub-directories when creating the consolidated test report? The plain Ant task has a ‘fileset includes’ attribute.

Any suggestions? Again, I want exactly one consolidated HTML report that includes all test results.


(Szczepan Faber) #2

Hey Thomas,

I understand that a consolidated test report for a multi-project build can be achieved by setting…

Actually, I don’t think it is officially supported. Did you manage to implement it? I can see several potential problems but I’m curious if you have found the workaround solid.

Gradle 1.4 brings some changes to the way the html reports are generated (namely, html is generated from internal test results instead of junit-fromatted xml test results.

Hope that helps!


(Peter Niederwieser) #3

I wonder if it’s possible to create a merged HTML report by sharing the same ‘testResultsDir’ between ‘Test’ tasks. Sounds like some people are doing just that.


(thomas.glaeser) #4

Yes, sharing the same ‘testResultsDir’ between ‘Test’ tasks works fine as of now until each test name is unique.

And yes, it is a workaround and I guess we all would prefer an official solution for that.

Will there be a solution for consolidated test reports after the changes to be introduced with Gradle 1.4?


(Szczepan Faber) #5

I’m afraid there won’t be a solution in 1.4. We do, however, have an ongoing work on the aggregated reporting which hopefully will be available in on of the next releases.


(dinio.dinev) #6

Hi, I want to ask if there will be support of consolidated test reports in Gradle 1.5 ver. And if yes, at the moment how can I consolidate test for a multi-project build using

Gradle 1.5.


(Luke Daley) #7

Something has been added in 1.4, of which the release candidate is available.

http://www.gradle.org/docs/release-candidate/release-notes#stand-alone-test-report-task