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

Parse error occur when NUnit report have categories

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.122, Windows 10 VM
    • Similar Issues:

      Description

      I'm using the xUnit plugin as part of a jenkins pipeline job. Since 2.0.0 each build fails when the test results are imported. Reverted to 1.104 and everything is fine again.

      The configuration step looks like this:

       // Publish test results
       step([$class: 'XUnitBuilder',
         thresholds: [
           [$class: 'SkippedThreshold', failureThreshold: '0'],
           [$class: 'FailedThreshold', failureThreshold: '0']
         ],
         tools: [[$class: 'NUnitJunitHudsonTestType', pattern: '**/*.dunit.xml']]
       ])
      

      The nunit result files are created with the nunit xml generator from the dunitx test framework.

      The error message is:

       [xUnit] [INFO] - Starting to record.
       [xUnit] [INFO] - Processing NUnit-2 (default)
       [xUnit] [INFO] - [NUnit-2 (default)] - 7 test report file(s) were found with the pattern '**/*.dunit.xml' relative to 'F:\Jenkins\workspace\xxxxxxxxxx' for the testing framework 'NUnit-2 (default)'.
       [xUnit] [ERROR] - Conversion error Error to convert the input XML document
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline]
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] // stage
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] }
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] // timeout
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] emailext
       Sending email to: T.Schroff@rac.de l.onken@rac.de t.schroff@rac.de
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] }
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] // node
       [8mha:////4CnuU6yLwwMSDpAULKjd4b71+GCayXnhpHkQgIlRCXAFAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA
       [Pipeline] End of Pipeline
       hudson.remoting.ProxyException: net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the first argument of substring() ("RunParser.A2L with EOL at EOF...", "fast") 
           at net.sf.saxon.expr.Expression.typeError(Expression.java:981)
           at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:270)
           at net.sf.saxon.functions.Substring.evaluateItem(Substring.java:24)
           at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:569)
           at net.sf.saxon.instruct.Choose.evaluateItem(Choose.java:715)
           at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:316)
           at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
           at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
           at net.sf.saxon.expr.LetExpression.process(LetExpression.java:370)
           at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:321)
           at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
           at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:321)
           at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
           at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
           at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
           at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
           at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:378)
           at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
           at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
           at net.sf.saxon.Controller.transform(Controller.java:1621)
           at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:231)
       Caused: hudson.remoting.ProxyException: net.sf.saxon.s9api.SaxonApiException: A sequence of more than one item is not allowed as the first argument of substring() ("RunParser.A2L with EOL at EOF...", "fast") 
           at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:233)
           at org.jenkinsci.lib.dtkit.util.converter.ConversionService.convert(ConversionService.java:350)
       Caused: hudson.remoting.ProxyException: org.jenkinsci.lib.dtkit.util.converter.ConversionException: Error to convert the input XML document
           at org.jenkinsci.lib.dtkit.util.converter.ConversionService.convert(ConversionService.java:356)
           at org.jenkinsci.lib.dtkit.util.converter.ConversionService.convert(ConversionService.java:172)
           at org.jenkinsci.lib.dtkit.model.InputMetricXSL.convert(InputMetricXSL.java:181)
           at org.jenkinsci.lib.dtkit.model.InputMetricXSL.convert(InputMetricXSL.java:189)
           at org.jenkinsci.plugins.xunit.service.XUnitConversionService.convertInputMetricXSL(XUnitConversionService.java:136)
           at org.jenkinsci.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:81)
       Caused: hudson.remoting.ProxyException: org.jenkinsci.plugins.xunit.exception.XUnitException: Conversion error Error to convert the input XML document
           at org.jenkinsci.plugins.xunit.service.XUnitConversionService.convert(XUnitConversionService.java:88)
           at org.jenkinsci.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:145)
       Caused: hudson.remoting.ProxyException: java.io.IOException: There are some problems during the conversion into JUnit reports: 
           at org.jenkinsci.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:182)
           at org.jenkinsci.plugins.xunit.service.XUnitTransformer.invoke(XUnitTransformer.java:44)
           at hudson.FilePath.act(FilePath.java:1047)
           at hudson.FilePath.act(FilePath.java:1025)
           at org.jenkinsci.plugins.xunit.XUnitProcessor.performTests(XUnitProcessor.java:207)
           at org.jenkinsci.plugins.xunit.XUnitProcessor.performXUnit(XUnitProcessor.java:150)
           at org.jenkinsci.plugins.xunit.XUnitBuilder.perform(XUnitBuilder.java:114)
           at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
           at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
           at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
           at hudson.security.ACL.impersonate(ACL.java:290)
           at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
           at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
           at java.util.concurrent.FutureTask.run(Unknown Source)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
       Finished: FAILURE
      

        Attachments

          Issue Links

            Activity

            Hide
            pablaasmo Per Arnold Blaasmo added a comment -

            We have the same problem in our Jenkins installation after updating to xUnit v2

            Please make a new release of the plugin with this fix ASAP.

            Show
            pablaasmo Per Arnold Blaasmo added a comment - We have the same problem in our Jenkins installation after updating to xUnit v2 Please make a new release of the plugin with this fix ASAP.
            Hide
            luebbe Lübbe Onken added a comment -

            Is there anything we can/should do on the Delphi side to bring the DUnitX NUnit style reports into the proper format?
            I could also implement a new writer that creats NUnit3 format.

            Show
            luebbe Lübbe Onken added a comment - Is there anything we can/should do on the Delphi side to bring the DUnitX NUnit style reports into the proper format? I could also implement a new writer that creats NUnit3 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-1.0-to-junit.xsl
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl
            src/test/java/org/jenkinsci/plugins/xunit/types/AbstractTest.java
            src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase11/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase11/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase12/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase12/result.xml
            http://jenkins-ci.org/commit/xunit-plugin/d714f7ad991531302aa2d70dce00d90b9ee74ea2
            Log:
            JENKINS-51481 Parse error occur when NUnit report have categories

            Improve testcase name when trim testsuite 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-1.0-to-junit.xsl src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl src/test/java/org/jenkinsci/plugins/xunit/types/AbstractTest.java src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase11/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase11/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase12/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase12/result.xml http://jenkins-ci.org/commit/xunit-plugin/d714f7ad991531302aa2d70dce00d90b9ee74ea2 Log: JENKINS-51481 Parse error occur when NUnit report have categories Improve testcase name when trim testsuite 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
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nikolas Falco
            Path:
            src/main/java/org/jenkinsci/plugins/xunit/types/NUnit.java
            src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-1.0-to-junit-2.xsl
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-1.0-to-junit.xsl
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.1.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.2.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.4.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.5.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.6.xsd
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl
            src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x.xsd
            src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase1/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase3/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/NUnit.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/NUnitUnicode.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase10/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase10/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase2/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase2/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase5/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase6/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase7/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase8/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase8/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase9/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase9/result.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/nunit3/testcase3/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/a97f56a2c67185cff9bd6349f41b7bd819d5844e
            Log:
            JENKINS-51481 Parse error occur when NUnit report have categories

            Create a new XSD compatible with all 2.x NUnit version (gathered NUnit XSD version from official distribution archive). Rewrite the XSL file to create a more complete JUnit report to support also categories and more.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/org/jenkinsci/plugins/xunit/types/NUnit.java src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-1.0-to-junit-2.xsl src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-1.0-to-junit.xsl src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.1.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.2.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.4.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.5.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.6.xsd src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x-to-junit.xsl src/main/resources/org/jenkinsci/plugins/xunit/types/nunit-2.x.xsd src/test/java/org/jenkinsci/plugins/xunit/types/NUnitTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase1/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase3/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/NUnit.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/NUnitUnicode.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase10/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase10/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase2/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase2/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase5/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase6/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase7/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase8/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase8/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase9/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit/testcase9/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/nunit3/testcase3/input.xml http://jenkins-ci.org/commit/xunit-plugin/a97f56a2c67185cff9bd6349f41b7bd819d5844e Log: JENKINS-51481 Parse error occur when NUnit report have categories Create a new XSD compatible with all 2.x NUnit version (gathered NUnit XSD version from official distribution archive). Rewrite the XSL file to create a more complete JUnit report to support also categories and more.
            Hide
            nfalco Nikolas Falco added a comment -

            The log produced by DUnit logger worked fine because the there was not XSD validation and the XSL was very tollerant. Both of them (miss of XSD and tollerant XSL) had cause open issues on the NUnit format.

            I gather all XSD from 2.x NUnit version and I'm rewriting the XSLT from scratch.
            The attached report seems use the latest 2.5 NUnit format but miss the environment element, required in all version except 2.4 (for some unknown reason), and for this reason the new XSD will works also against the logger you are using.

            When support for DUnit test will available is suggest to switch metric tool on it (feel free to submit a pull request for JENKINS-15137)

            Show
            nfalco Nikolas Falco added a comment - The log produced by DUnit logger worked fine because the there was not XSD validation and the XSL was very tollerant. Both of them (miss of XSD and tollerant XSL) had cause open issues on the NUnit format. I gather all XSD from 2.x NUnit version and I'm rewriting the XSLT from scratch. The attached report seems use the latest 2.5 NUnit format but miss the environment element, required in all version except 2.4 (for some unknown reason), and for this reason the new XSD will works also against the logger you are using. When support for DUnit test will available is suggest to switch metric tool on it (feel free to submit a pull request for JENKINS-15137 )

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                luebbe Lübbe Onken
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: