[JIRA] [nunit-plugin] (JENKINS-32999) Failed to transform nunit3 TestResult.xml

45 views
Skip to first unread message

fr1z2rt@gmail.com (JIRA)

unread,
Feb 17, 2016, 10:31:05 AM2/17/16
to jenkinsc...@googlegroups.com
Andrey Tretjakov created an issue
 
Jenkins / Bug JENKINS-32999
Failed to transform nunit3 TestResult.xml
Issue Type: Bug Bug
Assignee: Bruno P. Kinoshita
Components: nunit-plugin
Created: 17/Feb/16 3:30 PM
Priority: Major Major
Reporter: Andrey Tretjakov

ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
hudson.util.IOException2: Could not transform the NUnit report. Please report this issue to the plugin author
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:68)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:145)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Jenkins/jobs/ob.kontur.ru/workspace/temporary-junit-reports/temp-junit.xml; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102)
at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:63)
... 13 more

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

tenwit@yahoo.com (JIRA)

unread,
Feb 17, 2016, 4:11:01 PM2/17/16
to jenkinsc...@googlegroups.com
Paul Hicks updated an issue

XSLT file that transforms NUnit3 results to JUnit/xUnit results. Not strictly complete but more than good enough for Jenkins' use.

Change By: Paul Hicks
Attachment: nunit3-xunit.xslt

tenwit@yahoo.com (JIRA)

unread,
Feb 17, 2016, 4:11:02 PM2/17/16
to jenkinsc...@googlegroups.com
Paul Hicks commented on Bug JENKINS-32999
 
Re: Failed to transform nunit3 TestResult.xml

Here is an XSLT file that transforms NUnit3 results well enough for use with Jenkins. Some data is ignored (for example, NUnit's <failure> and <reason> in <test-suite> are ignored; only JUnit's <testcase> has the <failure> element). This works well for me with the JUnit publisher; I can view all suites and tests correctly, including TestCaseSource tests inside TestFixtures that have Tests.

I apply no restrictions to use of this file. You may use and publish this without attribution at any time.

nunit3-xunit.xslt

fr1z2rt@gmail.com (JIRA)

unread,
Feb 18, 2016, 10:05:01 AM2/18/16
to jenkinsc...@googlegroups.com

fr1z2rt@gmail.com (JIRA)

unread,
Feb 18, 2016, 10:06:02 AM2/18/16
to jenkinsc...@googlegroups.com
Andrey Tretjakov updated an issue
 
Change By: Andrey Tretjakov
ERROR: Step ‘Publish NUnit test result report’ aborted due to exception: 
hudson.util.IOException2: Could not transform the NUnit report. Please report this issue to the plugin author
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:68)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:145)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Jenkins/jobs/ ob.kontur.ru x /workspace/temporary-junit-reports/temp-junit.xml; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog.

at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102)
at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:63)
... 13 more

bjl2@cbord.com (JIRA)

unread,
Feb 18, 2016, 10:20:03 AM2/18/16
to jenkinsc...@googlegroups.com
Ben Langton commented on Bug JENKINS-32999
 
Re: Failed to transform nunit3 TestResult.xml

As an alternative, I am successfully using NUnit3 with the Jenkins NUnit plugin, by running the tests using a command line that includes: format=nunit2

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 3:02:01 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
That workaround is good but not great. There are several combinations of tests that display in Jenkins "rolled up" into a single test result, because they have the empty string as their name. This happens, for example, in [TestFixture]s that have both [Test]s and [TestCaseSource]s. In one of my projects, Jenkins was display over 10,000 results as a single line that couldn't be drilled into (no link to click).  The XSLT does handle these edge cases correctly.

Hopefully it'll be helpful to the
 maintain  maintainer  of this plugin. Or hopefully my own workload will drop off enough that I can contribute to the project :)

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 3:02:01 PM2/18/16
to jenkinsc...@googlegroups.com

That workaround is good but not great. There are several combinations of tests that display in Jenkins "rolled up" into a single test result, because they have the empty string as their name. This happens, for example, in [TestFixture]s that have both [Test]s and [TestCaseSource]s. In one of my projects, Jenkins was display over 10,000 results as a single line that couldn't be drilled into (no link to click). The XSLT does handle these edge cases correctly.

Hopefully it'll be helpful to the maintain of this plugin. Or hopefully my own workload will drop off enough that I can contribute to the project

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 3:03:02 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
That workaround is good but not great. There are several combinations of tests that display in Jenkins "rolled up" into a single test result, because they have the empty string as their name. This happens, for example, in [TestFixture]s that have both [Test]s and [TestCaseSource]s. In one of my projects, Jenkins was  display  displaying  over 10,000 results as a single line that couldn't be drilled into (no link to click).  The XSLT does handle these edge cases correctly.

Hopefully it'll be helpful to the maintainer of this plugin. Or hopefully my own workload will drop off enough that I can contribute to the project :)

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:51:02 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks updated an issue
 
Change By: Paul Hicks
Attachment: nunit3-xunit.xslt

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:51:02 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks updated an issue

Updated with test-case reason now producing a skipped element instead of a failure element.

Change By: Paul Hicks
Attachment: nunit3-xunit.xslt
Add Comment Add Comment
 

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:51:03 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
Here is an XSLT file that transforms NUnit3 results well enough for use with Jenkins. Some data is ignored (for example, NUnit's <failure> and <reason> in <test-suite> are ignored; only JUnit's <testcase> has the <failure> element). This works well for me with the JUnit publisher; I can view all suites and tests correctly, including TestCaseSource tests inside TestFixtures that have Tests.

I apply no restrictions to use of this file. You may use and publish this without attribution at any time.

[^nunit3-xunit.xslt]

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:52:01 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks updated an issue
Change By: Paul Hicks
Comment:
Updated with test-case reason now producing a skipped element instead of a failure element.

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:52:05 PM2/18/16
to jenkinsc...@googlegroups.com
Paul Hicks updated an issue
Change By: Paul Hicks
Attachment: nunit3-xunit.xslt

tenwit@yahoo.com (JIRA)

unread,
Feb 18, 2016, 5:53:01 PM2/18/16
to jenkinsc...@googlegroups.com

brunodepaulak@yahoo.com.br (JIRA)

unread,
Mar 11, 2016, 8:28:02 PM3/11/16
to jenkinsc...@googlegroups.com
Bruno P. Kinoshita commented on Bug JENKINS-32999
 
Re: Failed to transform nunit3 TestResult.xml

Thanks for all the comments and investigation. I'm filing another issue that I received via e-mail (regarding BOM in NUnit XML) and will start triaging issues during the next days. Aiming at a new release within one or two weeks. Sorry for the delay (busy with $work).

wilson@mace.systems (JIRA)

unread,
Apr 7, 2016, 8:37:06 AM4/7/16
to jenkinsc...@googlegroups.com

Hi There, I am trying to get the default XML being outputed by Nunit3-console.exe being parsed into the nunit3-xunit.xslt as suggested by Paul Hicks, I'm having some trouble with the command can anyone suggest a point? My current command is:

"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "C:\VisualStudios2015Repo\Mace E-Commerce Development\MACE_eCommerce_MAIN\Mace_E-Commerce_Project\WebUnitTest\bin\Debug\WebUnitTest.dll" transform=Conversion.xslt

wilson@mace.systems (JIRA)

unread,
Apr 7, 2016, 9:50:05 AM4/7/16
to jenkinsc...@googlegroups.com
Wilson Li edited a comment on Bug JENKINS-32999
Hi There, I am trying to get the default XML being outputed by Nunit3-console.exe being parsed into the nunit3-xunit.xslt as suggested by Paul Hicks, I'm having some trouble with the command can anyone suggest a point? My current command is:


"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe"  "C:\VisualStudios2015Repo\Mace E-Commerce Development\MACE_eCommerce_MAIN\Mace_E-Commerce_Project\WebUnitTest\bin\Debug\WebUnitTest.dll" transform=Conversion.xslt



I have retried down versioning the output from nunit3 to nunit2 and use NUnit to publish the report. This is now working. The origional issue still stands for the command. Maybe usful for someone else

tenwit@yahoo.com (JIRA)

unread,
Apr 7, 2016, 4:47:02 PM4/7/16
to jenkinsc...@googlegroups.com

This command works for me:

nunit3-console.exe Gsfa.Pams.Test.CodedServices/bin/Debug/Gsfa.Pams.Test.CodedServices.dll --where "name == /ElectNewTokelauIslandsRetiringAllowanceMedical/" --explore=JunitTestResults.xml;transform=nunit3-junit.xslt

When I'm running in mintty or any other bash-style shell, I have to escape the semicolon ("\;transform=nunit3-junit.xslt")

I've renamed nunit3-xunit.xslt to nunit3-junit.xslt on my machine. It's the same file though.

tenwit@yahoo.com (JIRA)

unread,
Apr 7, 2016, 4:47:03 PM4/7/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
This command works for me:

{{nunit3-console.exe Gsfa.Pams.Test.CodedServices/bin/Debug/Gsfa.Pams.Test.CodedServices.dll --where "name == / ElectNewTokelauIslandsRetiringAllowanceMedical MyTestName /" --explore=JunitTestResults.xml;transform=nunit3-junit.xslt}}


When I'm running in mintty or any other bash-style shell, I have to escape the semicolon ("\;transform=nunit3-junit.xslt")

I've renamed nunit3-xunit.xslt to nunit3-junit.xslt on my machine.  It's the same file though.

tenwit@yahoo.com (JIRA)

unread,
Apr 7, 2016, 4:48:01 PM4/7/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
This command works for me:

{{nunit3-console.exe  Gsfa.Pams.Test.CodedServices  MyProject /bin/Debug/ Gsfa MyAssembly . Pams.Test.CodedServices. dll --where "name == /MyTestName/" --explore=JunitTestResults.xml;transform=nunit3-junit.xslt}}


When I'm running in mintty or any other bash-style shell, I have to escape the semicolon ("\;transform=nunit3-junit.xslt")

I've renamed nunit3-xunit.xslt to nunit3-junit.xslt on my machine.  It's the same file though.

tenwit@yahoo.com (JIRA)

unread,
Apr 7, 2016, 4:55:01 PM4/7/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
This command works for me:

{{nunit3-console.exe MyProject/bin/Debug/MyAssembly.dll --where "name == /MyTestName/" -- explore report =JunitTestResults.xml;transform=nunit3-junit.xslt}}


When I'm running in mintty or any other bash-style shell, I have to escape the semicolon ("\;transform=nunit3-junit.xslt")

I've renamed nunit3-xunit.xslt to nunit3-junit.xslt on my machine.  It's the same file though.

tenwit@yahoo.com (JIRA)

unread,
Apr 7, 2016, 8:18:02 PM4/7/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
This command works for me:

{{nunit3-console.exe MyProject/bin/Debug/MyAssembly.dll --where "name == /MyTestName/" -- report result =JunitTestResults.xml;transform=nunit3-junit.xslt}}


When I'm running in mintty or any other bash-style shell, I have to escape the semicolon ("\;transform=nunit3-junit.xslt")

I've renamed nunit3-xunit.xslt to nunit3-junit.xslt on my machine.  It's the same file though.

vadivelkarti@gmail.com (JIRA)

unread,
Nov 10, 2016, 5:05:03 AM11/10/16
to jenkinsc...@googlegroups.com

Hi All,

Am using windows machine and am facing issues if i use the above Paul Hicks command. Could anyone please redirect me in a proper way to get this run in my machine. I have tried both Junit and Nunit plugins. In both, am getting error.

Nunit

Results (nunit3) saved as TestResult.xml

C:\Jenkins\workspace\testing22>exit -2
Build step 'Execute Windows batch command' marked build as failure
Recording NUnit tests results


ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:

java.io.IOException: Could not transform the NUnit report. Please report this issue to the plugin author
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:71)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:29)
at hudson.FilePath.act(FilePath.java:996)
at hudson.FilePath.act(FilePath.java:974)
at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:153)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1745)


at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:401)
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Jenkins/workspace/testing22/temporary-junit-reports/temp-junit.xml; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog.


at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102)
at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72)

at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:66)

Junit

Results (nunit3) saved as TestResult.xml

C:\Jenkins\workspace\testing22>exit 0
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: None of the test reports contained any result
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

vadivelkarti@gmail.com (JIRA)

unread,
Nov 10, 2016, 5:46:03 AM11/10/16
to jenkinsc...@googlegroups.com

Please find my detailed error got from command prompt in windows machine.

C:\Jenkins\workspace\Server\build\tools\NUnit.ConsoleRunner\tools>nunit3-console.exe "C:\Jenkins\workspace\Server\test\Server.Tests\bin\Release\Server.Tests.dll" --result=junit-results.xml;transform=C:\Jenkins\workspace\testing22\nunit3-junit.xslt

NUnit Console Runner 3.5.0
Copyright (C) 2016 Charlie Poole

Runtime Environment
OS Version: Microsoft Windows NT 6.3.9600.0
CLR Version: 4.0.30319.42000

Test Files
C:\Jenkins\workspace\Server\test\Server.Tests\bin\Release\Server.Tests.dll

System.ArgumentException: Unable to load transform C:\Jenkins\workspace\testing2
2\nunit3-junit.xslt ---> System.Xml.XmlException: For security reasons DTD is pr
ohibited in this XML document. To enable DTD processing set the DtdProcessing pr
operty on XmlReaderSettings to Parse and pass the settings into XmlReader.Create
method.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.Xsl.Xslt.XsltInput.ReadTextNodes()
at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()
at System.Xml.Xsl.Xslt.XsltInput.FindStylesheetElement()
at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()
at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean in
clude)
— End of inner exception stack trace —
at NUnit.Engine.Services.XmlTransformResultWriter..ctor(Object[] args)
at NUnit.Engine.Services.ResultService.GetResultWriter(String format, Object[
] args)
at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter
filter)
at NUnit.ConsoleRunner.Program.Main(String[] args)

tenwit@yahoo.com (JIRA)

unread,
Nov 10, 2016, 2:27:04 PM11/10/16
to jenkinsc...@googlegroups.com

There is no DTD in the XSLT. It starts like this:

{{<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>}}

Can you inspect the XSLT that you're using and check that it's the same as the one attached? Or better, use the one from the nunit\transforms github project.

It may be that the one you have has a BOM (byte order mark) when it shouldn't, or maybe there's an issue with newlines. It is possible that the download process or something changed the file in some small way that renders it invalid for use by NUnit.

tenwit@yahoo.com (JIRA)

unread,
Nov 10, 2016, 2:29:06 PM11/10/16
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-32999
There is no DTD in the XSLT.  It starts like this:

{ { quote}
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes"/> {quote } }

Can you inspect the XSLT that you're using and check that it's the same as the one attached? Or better, use the one from the nunit\transforms github project.

It may be that the one you have has a BOM (byte order mark) when it shouldn't, or maybe there's an issue with newlines. It is possible that the download process or something changed the file in some small way that renders it invalid for use by NUnit.

slide.o.mix@gmail.com (JIRA)

unread,
Feb 16, 2017, 7:45:09 PM2/16/17
to jenkinsc...@googlegroups.com
Alex Earl closed an issue as Duplicate
 
Change By: Alex Earl
Status: Open Closed
Assignee: Bruno P. Kinoshita Alex Earl
Resolution: Duplicate
Reply all
Reply to author
Forward
0 new messages