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

Failure when validate NUnit 2.x reports generated by NUnit 3.x console

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • xunit-plugin
    • None
    • Jenkins & Agents: Windows 2012R2 64 bit
      Jenkins 2.137
      xUnit: 2.2.1

    Description

      In may I registered JENKINS-51561. It may be that that actual problem was solved but xUnit still cannot parse our NUnit 2 files. The build log reports:

      12:24:23 INFO: Processing NUnit-2.x (default)
      12:25:16 INFO: [NUnit-2.x (default)] - 15 test report file(s) were found with the pattern '**/target/TestResults.xml' relative to 'C:\jks\ws\Classic-AMIS_Trunk_Build' for the testing framework 'NUnit-2.x (default)'.
      12:25:17 WARNING: The file 'C:\jks\ws\Classic-AMIS_Trunk_Build\Classic-AMIS-AdapterCommon\target\TestResults.xml' is an invalid file.
      12:25:17 WARNING: At line 29 of file:/C:/jks/ws/Classic-AMIS_Trunk_Build/Classic-AMIS-AdapterCommon/target/TestResults.xml:cvc-complex-type.2.4.d: Invalid content was found starting with element 'test-suite'. No child element is expected at this point.
      12:25:17 ERROR: Failed to parse POMs
      12:25:17 org.jenkinsci.plugins.xunit.service.TransformerException: The result file 'C:\jks\ws\Classic-AMIS_Trunk_Build\Classic-AMIS-AdapterCommon\target\TestResults.xml' for the metric 'NUnit' is not valid. The result file has been skipped.
      12:25:17 	at org.jenkinsci.plugins.xunit.service.XUnitTransformerCallable.invoke(XUnitTransformerCallable.java:112)
      12:25:17 	at org.jenkinsci.plugins.xunit.service.XUnitTransformerCallable.invoke(XUnitTransformerCallable.java:39)
      12:25:17 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3084)
      12:25:17 	at hudson.remoting.UserRequest.perform(UserRequest.java:210)
      12:25:17 	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
      12:25:17 	at hudson.remoting.Request$2.run(Request.java:358)
      12:25:17 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      12:25:17 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      12:25:17 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      12:25:17 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      12:25:17 	at hudson.remoting.Engine$1$1.run(Engine.java:94)
      12:25:17 	at java.lang.Thread.run(Thread.java:745)
      12:25:17 	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from chdev1074.intern.csam.no/10.14.80.130:49648
      12:25:17 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
      12:25:17 		at hudson.remoting.UserResponse.retrieve(UserRequest.java:389)
      12:25:17 		at hudson.remoting.Channel.call(Channel.java:955)
      12:25:17 		at hudson.FilePath.act(FilePath.java:1070)
      12:25:17 		at hudson.FilePath.act(FilePath.java:1059)
      12:25:17 		at org.jenkinsci.plugins.xunit.XUnitProcessor.processTestsReport(XUnitProcessor.java:180)
      12:25:17 		at org.jenkinsci.plugins.xunit.XUnitProcessor.process(XUnitProcessor.java:150)
      12:25:17 		at org.jenkinsci.plugins.xunit.XUnitBuilder.perform(XUnitBuilder.java:114)
      12:25:17 		at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
      12:25:17 		at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      12:25:17 		at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      12:25:17 		at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
      12:25:17 		at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
      12:25:17 		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      12:25:17 		at hudson.model.Run.execute(Run.java:1815)
      12:25:17 		at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      12:25:17 		at hudson.model.ResourceController.execute(ResourceController.java:97)
      12:25:17 		at hudson.model.Executor.run(Executor.java:429)
      

      The actual TestResult.xml file is attached.

      This has been a problem with all the 2.x versions I've tried, and works fine with 1.104.

      Attachments

        Activity

          nfalco Nikolas Falco added a comment -

          In the previous issue you wrote that you enable NUnit 2.x format because NUnit 3.x was not enable. What's happens if you produce the use NUnit 3.x.

          Which tools produce the NUnit 2.x format? The issue seems to be that the report file contains a concat of more assemblies and this does not respect the original schema files.

          nfalco Nikolas Falco added a comment - In the previous issue you wrote that you enable NUnit 2.x format because NUnit 3.x was not enable. What's happens if you produce the use NUnit 3.x. Which tools produce the NUnit 2.x format? The issue seems to be that the report file contains a concat of more assemblies and this does not respect the original schema files.

          Unfortunately generating NUnit 3.x format would require a fair amount of yak-shaving for which I don't have the time right now. The testreports are generated with NUnit Console 3.8.0 so it seems strange that it wouldn't follow the NUnit 2.x specification. But if that is the case, maybe it would be more appropriate to send a bug-report to the NUnit team?

          Reading the code, we're calling it like this:

          ${env.PROGRAMFILES(X86)}/NUnit.org/nunit-console/nunit3-console.exe -result ${project.build.directory}/TestResults.xml;format=nunit2 <paths to test-dlls>

          jjvdgeer Jan-Jaap van der Geer added a comment - Unfortunately generating NUnit 3.x format would require a fair amount of yak-shaving for which I don't have the time right now. The testreports are generated with NUnit Console 3.8.0 so it seems strange that it wouldn't follow the NUnit 2.x specification. But if that is the case, maybe it would be more appropriate to send a bug-report to the NUnit team? Reading the code, we're calling it like this: ${env.PROGRAMFILES(X86)}/NUnit.org/nunit-console/nunit3-console.exe -result ${project.build.directory}/TestResults.xml;format=nunit2 <paths to test-dlls>
          nfalco Nikolas Falco added a comment -

          Thank for the details. The XSD I'm using comes from the NUnit 2.6 distribution zip (source here)

          In the meanwhile I can relax the constraint. Please open an issue to the NUnit Console because produce a NUnit 2.x format not compliant with their NUnit 2.6.4 schema. It's better if you open the issue instead of me since you are more confident with the C# tools in case of technical question or on how to reproduce the issue.

          nfalco Nikolas Falco added a comment - Thank for the details. The XSD I'm using comes from the NUnit 2.6 distribution zip ( source here ) In the meanwhile I can relax the constraint. Please open an issue to the NUnit Console because produce a NUnit 2.x format not compliant with their NUnit 2.6.4 schema. It's better if you open the issue instead of me since you are more confident with the C# tools in case of technical question or on how to reproduce the issue.
          jjvdgeer Jan-Jaap van der Geer added a comment - The issue is reported to the NUnit team: https://github.com/nunit/nunit-v2-result-writer/issues/13

          Just tested with the new version, I can confirm it works now! Thanks!

          jjvdgeer Jan-Jaap van der Geer added a comment - Just tested with the new version, I can confirm it works now! Thanks!

          People

            nfalco Nikolas Falco
            jjvdgeer Jan-Jaap van der Geer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: