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

xUnit plugin fails to parse NUnit 2 report format generated by NUnit 3.6.0.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
    • Environment:
      Jenkins & Agents: Windows 2012R2 64 bit
      Jenkins 2.124
      xUnit: 2.0.0
    • Similar Issues:

      Description

      We upgraded our xUnit plugin from 1.104 to 2.0.0. After that the builds started to fail. The failure is in the last part of the build and seems to have to do with parsing of the unittest-results.

      We're parsing as "nUnit-2 (default)".

      The build log reports:

      09:22:03 [xUnit] [ERROR] - Conversion error Error to convert the input XML document
      09:22:03 ERROR: Failed to parse POMs
      09:22:03 java.io.IOException: remote file operation failed: C:/jks/ws/Classic-AMIS_2.50.X_Build at hudson.remoting.Channel@d1a67e:JNLP4-connect connection from chdev1074.intern.csam.no/10.14.80.130:61390: java.io.IOException: Failed to deserialize response to UserRequest:org.jenkinsci.plugins.xunit.service.XUnitTransformer@14b5f21: java.lang.SecurityException: Rejected: net.sf.saxon.expr.CardinalityChecker; see https://jenkins.io/redirect/class-filter/
      

      The slaves errorlog reports:

      INFO: [xUnit] - [NUnit-2 (default)] - 14 test report file(s) were found with the pattern '**/target/TestResults.xml' relative to 'C:\jks\ws\Classic-AMIS_2.50.X_Build' for the testing framework 'NUnit-2 (default)'.
      Error on line 59 
        XPTY0004: A sequence of more than one item is not allowed as the first argument of
        substring() ("TMService.UnitTests.TMServiceT...", "_IGNOREREASON") 
        at xsl:for-each (#53)
           processing /test-results/test-suite[1]/results[1]/test-suite[1]/results[1]/test-suite[1]/results[1]/test-suite[3]
        at xsl:for-each (#51)
           processing /test-results/test-suite[1]/results[1]/test-suite[1]/results[1]/test-suite[1]/results[1]/test-suite[3]/results[1]/test-case[1]
        in built-in template rule
      org.jenkinsci.plugins.xunit.exception.XUnitException: Conversion error Error to convert the input XML document
      

      and

      Caused by: net.sf.saxon.s9api.SaxonApiException: A sequence of more than one item is not allowed as the first argument of substring() ("TMService.UnitTests.TMServiceT...", "_IGNOREREASON") 
      

      See the enclosed buildlog and jenkins-slave.err.log extract. I've also included the problematic TestResults.xml file (created by NUnit Console 3.8.0).

      I think it has problems handling test-runs where no tests were actually run.

      Reverting to 1.104 of the xUnit plugin fixes the problem.

        Attachments

        1. TestResults.xml
          6 kB
        2. jenkins-slave.err.log
          5 kB
        3. buildlog.txt
          7 kB

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Linked the related issues, likely there are duplicates

            Show
            oleg_nenashev Oleg Nenashev added a comment - Linked the related issues, likely there are duplicates
            Hide
            nfalco Nikolas Falco added a comment - - edited

            Is it ran with NUnit 3.6 but the generated report transformed in NUni2 format?

            In case in latest version there is support for NUnit 3.x format.

            Show
            nfalco Nikolas Falco added a comment - - edited Is it ran with NUnit 3.6 but the generated report transformed in NUni2 format? In case in latest version there is support for NUnit 3.x format.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nikolas Falco
            Path:
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl
            src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase13/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase13/result.xml
            http://jenkins-ci.org/commit/xunit-plugin/363735d31c94858cbfc4fc8811854465da2d86f3
            Log:
            JENKINS-51561 xUnit plugin fails to parse NUnit 2 report format generated by NUnit 3.6.0.0

            Fix parse of nunit-version attribute to decide how to compose testcase classname and name.

            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase13/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase13/result.xml http://jenkins-ci.org/commit/xunit-plugin/363735d31c94858cbfc4fc8811854465da2d86f3 Log: JENKINS-51561 xUnit plugin fails to parse NUnit 2 report format generated by NUnit 3.6.0.0 Fix parse of nunit-version attribute to decide how to compose testcase classname and name. * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            Hide
            jjvdgeer Jan-Jaap van der Geer added a comment -

            Nikolas Falco When we switched to running the unit tests with the NUnit-console runner in october last year we had to switch to NUnit 2 format because xUnit did not support NUnit 3 format. Are you now saying that xUnit 2.0 does support NUnit 3 format but no longer the NUnit 2 format?

            Show
            jjvdgeer Jan-Jaap van der Geer added a comment - Nikolas Falco When we switched to running the unit tests with the NUnit-console runner in october last year we had to switch to NUnit 2 format because xUnit did not support NUnit 3 format. Are you now saying that xUnit 2.0 does support NUnit 3 format but no longer the NUnit 2 format?
            Hide
            nfalco Nikolas Falco added a comment -

            Both format are supported, you no longer need to produce in version 2 report when you run NUni3

            Show
            nfalco Nikolas Falco added a comment - Both format are supported, you no longer need to produce in version 2 report when you run NUni3
            Hide
            jjvdgeer Jan-Jaap van der Geer added a comment -

            I've edited the attachment 'buildlog.txt' so that the email addresses are redacted away.

            Show
            jjvdgeer Jan-Jaap van der Geer added a comment - I've edited the attachment 'buildlog.txt' so that the email addresses are redacted away.

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                jjvdgeer Jan-Jaap van der Geer
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: