How do you enable XML report output for JUnit

I would like to have the JUnit output be xml so that the Jenkins JUnit plugin can format reports. The default report is html. I’ve searched through the DSL documentation and the source code to no avail.

Thanks in advance,

Bart

I believe both are generated. HTML in build/reports/tests, XML in build/test-results.

My Jenkins jobs set Test report XMLs = **/build/test-results/TEST-*.xml

I believe both are generated. HTML in build/reports/tests, XML in build/test-results.

My Jenkins jobs set

Test report XMLs = **/build/test-results/TEST-*.xml
1 Like

What version of gradle are you using? I’m 1.0-rc2 and the default report format is html, so the *.xml notation isn’t going to find anything.

To be clear: the XML is the Output generated by junit itself. The html report is generated by gradle. The XML Results are located in $buildDir/test-results.

3 Likes

The XML report is also coming from Gradle. The XML report format was introduced by Ant and later adapted by Maven (and Gradle). Contrary to common belief, JUnit itself doesn’t provide any reports.

2 Likes

Okay, thanks for clarifying this. Always thought it was generated by junit itself

Thanks Rene, that’s the answer I needed! Dan provided the correct answer too, my brain just really wanted the xml in the same directory as the html.

Thanks everyone!