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

NUnit plugin fails while converting to JUnit XML

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nunit-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.599
    • Similar Issues:

      Description

      My NUnit tests run fine, but when i'm trying to get my information to report i get an error:

      Results (nunit3) saved as TestResult.xml

      C:\Program Files (x86)\Jenkins\workspace\NUnit Testie Test>exit 0
      Recording NUnit tests results
      ERROR: Publisher hudson.plugins.nunit.NUnitPublisher 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:60)
      at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
      at hudson.FilePath.act(FilePath.java:989)
      at hudson.FilePath.act(FilePath.java:967)
      at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:116)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      at hudson.model.Run.execute(Run.java:1743)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Program%20Files%20(x86)/Jenkins/workspace/NUnit%20Testie%20Test/temporary-junit-reports/temp-junit.xml; lineNumber: 32; columnNumber: 1; Premature end of file.
      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:55)
      ... 13 more
      Finished: FAILURE


      I'm new to Jenkins and have been hacking away here but something just isn't right here.

      I checked the TestResults.xml and it's populated and verified it's in my workspace.

      *check image/xml attached
      workspace.png and TestResult.xml

      In the error i see it reference:
      file:/C:/Program%20Files%20(x86)/Jenkins/workspace/NUnit%20Testie%20Test/temporary-junit-reports/temp-junit.xml;

      I checked an the file has a lot of hard returns but no data in it.

      temp-junit.xml attached

      Also noted PostBuild.png attached.

      Any help would be great. I have both the NUnit plug in installed as well as the xUnit.

      Just trying to figure out how to get them to show me what i need.

      Thanks
      Ren

        Attachments

        1. PostBuild.png
          PostBuild.png
          18 kB
        2. temp-junit.xml
          0.4 kB
        3. TestResult.xml
          3 kB
        4. Workspace.png
          Workspace.png
          29 kB

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          Fixed in 0.19 (added support for NUnit3)

          Show
          slide_o_mix Alex Earl added a comment - Fixed in 0.19 (added support for NUnit3)
          Hide
          jonathan_fletcher Jonathan Fletcher added a comment -

          Now that NUnit3 is released, is there a plan for fixing this? We recently upgraded from NUnit to NUnit3 and the XUnit plugin stopped working for us.

          Show
          jonathan_fletcher Jonathan Fletcher added a comment - Now that NUnit3 is released, is there a plan for fixing this? We recently upgraded from NUnit to NUnit3 and the XUnit plugin stopped working for us.
          Hide
          sttodorov Stoyan Todorov added a comment - - edited

          I had the same issue using xUnit plugin. Now when Nunit3 is released and Nunit3 results xml format is defined https://github.com/nunit/nunit/wiki/Test-Result-XML-Format this can be fixed.

          This is the log
          [xUnit] [INFO] - Converting 'c:\jenkins\workspace\Framework Build Acceptance Test\TestResults\TestResult.xml' .
          [xUnit] [INFO] - Using the native embedded stylesheet in JENKINS_HOME.
          [xUnit] [ERROR] - The converted file for the result file 'c:\jenkins\workspace\Framework Build Acceptance Test\TestResults\TestResult.xml' (during conversion process for the metric 'NUnit') is not valid. The report file has been skipped.
          [xUnit] [ERROR] - Content is not allowed in prolog.
          [xUnit] [ERROR] - Content is not allowed in prolog.
          [xUnit] [ERROR] - There is at least one problem. Check the Jenkins system log for more information. (if you don't have configured yet the system log before, you have to rebuild).
          [xUnit] [ERROR] - The plugin hasn't been performed correctly: Problem on deletion

          Show
          sttodorov Stoyan Todorov added a comment - - edited I had the same issue using xUnit plugin. Now when Nunit3 is released and Nunit3 results xml format is defined https://github.com/nunit/nunit/wiki/Test-Result-XML-Format this can be fixed. This is the log [xUnit] [INFO] - Converting 'c:\jenkins\workspace\Framework Build Acceptance Test\TestResults\TestResult.xml' . [xUnit] [INFO] - Using the native embedded stylesheet in JENKINS_HOME. [xUnit] [ERROR] - The converted file for the result file 'c:\jenkins\workspace\Framework Build Acceptance Test\TestResults\TestResult.xml' (during conversion process for the metric 'NUnit') is not valid. The report file has been skipped. [xUnit] [ERROR] - Content is not allowed in prolog. [xUnit] [ERROR] - Content is not allowed in prolog. [xUnit] [ERROR] - There is at least one problem. Check the Jenkins system log for more information. (if you don't have configured yet the system log before, you have to rebuild). [xUnit] [ERROR] - The plugin hasn't been performed correctly: Problem on deletion
          Hide
          sttodorov Stoyan Todorov added a comment -

          NUnit3 tests results xml file

          Show
          sttodorov Stoyan Todorov added a comment - NUnit3 tests results xml file
          Hide
          mezzano Tanguy Mezzano added a comment -

          I use xUnit and it now works like a charm: https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin

          Show
          mezzano Tanguy Mezzano added a comment - I use xUnit and it now works like a charm: https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin
          Hide
          mezzano Tanguy Mezzano added a comment -

          I have the same problem, any updates since then?

          Show
          mezzano Tanguy Mezzano added a comment - I have the same problem, any updates since then?
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Sorry Ren, I haven't had time to reproduce the issue in my dev environment. I'll be busy until mid May with personal and $work errands, but if you have a pull request in GitHub we can discuss and merge/release it. Thanks!

          Show
          kinow Bruno P. Kinoshita added a comment - Sorry Ren, I haven't had time to reproduce the issue in my dev environment. I'll be busy until mid May with personal and $work errands, but if you have a pull request in GitHub we can discuss and merge/release it. Thanks!
          Hide
          renmg Ren Goodman added a comment -

          Any updates? Ideas? Thoughts?

          Show
          renmg Ren Goodman added a comment - Any updates? Ideas? Thoughts?

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              renmg Ren Goodman
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: