Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32999

Failed to transform nunit3 TestResult.xml

    Details

    • Similar Issues:

      Description

      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/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

        Attachments

          Issue Links

            Activity

            Hide
            wilson Wilson Li added a comment - - edited

            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

            Show
            wilson Wilson Li added a comment - - edited 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
            Hide
            tenwit Paul Hicks added a comment - - edited

            This command works for me:

            nunit3-console.exe MyProject/bin/Debug/MyAssembly.dll --where "name == /MyTestName/" --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.

            Show
            tenwit Paul Hicks added a comment - - edited This command works for me: nunit3-console.exe MyProject/bin/Debug/MyAssembly.dll --where "name == /MyTestName/" --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.
            Hide
            vadivel Vadivel Natarajan added a comment -

            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

            Show
            vadivel Vadivel Natarajan added a comment - 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
            Hide
            vadivel Vadivel Natarajan added a comment -

            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)

            Show
            vadivel Vadivel Natarajan added a comment - 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)
            Hide
            tenwit Paul Hicks added a comment - - edited

            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.

            Show
            tenwit Paul Hicks added a comment - - edited 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.

              People

              • Assignee:
                slide_o_mix Alex Earl
                Reporter:
                fr1z2r Andrey Tretjakov
              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: