diff --git a/nunit3-junit/README.md b/nunit3-junit/README.md index ea6ba67..072c853 100644 --- a/nunit3-junit/README.md +++ b/nunit3-junit/README.md @@ -4,7 +4,11 @@ Converts NUnit3 results to JUnit-style results. It deliberately drops some infor The Jenkins NUnit publisher ("NUnit plugin" for Jenkins) requires NUnit2-style results and isn't keeping up with the snazziness of the JUnit plugin. Of particular interest to me, the JUnit plugin allows for claiming of individual test failures. XML files produced by transforming NUnit3 results with the attached XLST file are suitable for publishing via the JUnit plugin. -This transformation is XSLT 1.0 compliant. It would be simpler if it used XSL 2.0; for example, the for-each loop in the test-suite template could be reduced to a simple string-join. However since Jenkins doesn't (yet) have an XSLT plugin, I find that the easier way to use this transform in Jenkins is via Powershell, which currently (February 2016) supports only XSLT 1.0. +The transform is usually used via nunit-console's --result option: + + nunit3-console.exe YourTestAssembly.dll --result=junit-results.xml;transform=nunit3-junit.xslt + +This transform is XSLT 1.0 compliant. It would be simpler if it used XSL 2.0; for example, the for-each loop in the test-suite template could be reduced to a simple string-join. XSLT 1.0 was chosen so that it can be used with Powershell, which currently (February 2016) supports only XSLT 1.0. If you would like to run this using Powershell, here is a minimal Powershell script which you can run from Jenkins via the Powershell plugin. It uses the default NUnit output file name TestResults.xml and transforms it to a new file junit-results.xml, which you can then publish to Jenkins using the JUnit plugin. diff --git a/nunit3-junit/nunit3-xunit.xslt b/nunit3-junit/nunit3-junit.xslt similarity index 96% rename from nunit3-junit/nunit3-xunit.xslt rename to nunit3-junit/nunit3-junit.xslt index 8cb1d88..6ae97e8 100644 --- a/nunit3-junit/nunit3-xunit.xslt +++ b/nunit3-junit/nunit3-junit.xslt @@ -1,66 +1,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +