I'm currently using Jenkins Workflow with a project that is producing NUnit test results.
I've tried using a simple build step to archive these test results
step([$class: "JUnitResultArchiver", artifacts: "Test-Results/**/*.*"])
Unfortunately it seems the JUnit archiver is unable to parse the XML produced by nunit-console
, it outputs that the file contains no results. I'm guessing this is because there are differences between JUnit and NUnit in terms of the XML schema (I probably should have realized this).
The Jenkins NUnit plugin is able to parse the file but it seems the plugin isn't yet implementing the simple build step required for it to be used with Workflow.
Has anyone found a way to get this working or do we have to wait for the NUnit plugin to be made Workflow friendly?
Transform the the nunit result file "TestResult.xml", using the below command.
bat '"h:\\tools\\msxsl.exe" "TestResult.xml" "nunit-to-junit.xsl" -o JUnitLikeNunitResults.xml'
you can download the "msxsl.exe"
from the MS site, for the "nunit-to-junit.xsl"
you can grab it from the nunit test publishing plugin for jenkins source code.
Once this is done, use the step
to publish
step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testResults: 'JUnitLikeNunitResults.xml'])
I used nunit3-xunit transform in generation of my unit test report and then was able to use junit publish step in pipeline plug in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With