How do you enable XML report output for JUnit


(bart.spedden) #1

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


(Dan Stine) #2

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


(Dan Stine) #3

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

(bart.spedden) #4

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.


(René Groeschke) #5

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.


(Peter Niederwieser) #6

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.


(René Groeschke) #7

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


(bart.spedden) #8

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!