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

xUnit cannot parse JUnit output from a Gradle build because of empty <properties> element

    Details

    • Similar Issues:

      Description

      Running a simple Gradle configuration, the xUnit plugin cannot validate JUnit output files because the <properties> element is empty. There does not appear to be a canonical schema for JUnit XML output, but informal sources (eg, http://windyroad.com.au/2011/02/07/apache-ant-junit-xml-schema/) allow 0..n <property> tags inside of a <properties> tag.

      Jenkins gives the following output:

      Jun 12, 2013 7:00:13 PM com.thalesgroup.hudson.plugins.xunit.service.XUnitService errorSystemLogger
      SEVERE: [xUnit] - The result file 'C:\Programs\jenkins\jobs\Midas Testing\workspace\ssi\build\test-results\TEST-com.stottlerhenke.ssi.report.io.TestReportConfig.xml' for the metric 'JUnit' is not valid. The result file has been skipped.
      
      Jun 12, 2013 7:00:13 PM com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger
      WARNING: [xUnit] - The file 'C:\Programs\jenkins\jobs\Midas Testing\workspace\ssi\build\test-results\TEST-com.stottlerhenke.ssi.report.io.TestReportConfig.xml' is an invalid file.
      
      Jun 12, 2013 7:00:13 PM com.thalesgroup.hudson.plugins.xunit.service.XUnitService errorSystemLogger
      

      I am attaching a sample file that fails to validate with com.thalesgroup.dtkit.junit.model.JUnitModel.OUTPUT_JUNIT_6. Validating this file gives the following error:

      At line 3 of file:///C:/Users/kmahan/Projects/JUnitTest/build/test-results/TEST-MyTest.xml:cvc-complex-type.2.4.b: The content of element 'properties' is not complete. One of '{"":property}' is expected.
      

      My proposed fix would add minOccurs="0" to the properties element in junit-6.xsd (and possibly the other junit schemas as well?) to allow for empty properties elements.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase4/input.xml
          http://jenkins-ci.org/commit/xunit-plugin/cc73495fbf650a266ee2db662c5e62f260725c94
          Log:
          Add test for JENKINS-18341

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase4/input.xml http://jenkins-ci.org/commit/xunit-plugin/cc73495fbf650a266ee2db662c5e62f260725c94 Log: Add test for JENKINS-18341
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/xunit/types/JUnitInputMetric.java
          src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java
          src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase1/result.xml
          src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase2/result.xml
          src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase3/input.xml
          http://jenkins-ci.org/commit/xunit-plugin/4a9dd4c67e95a428f5d9630ac5b4046b42cc91ad
          Log:
          Fix JENKINS-18341

          Compare: https://github.com/jenkinsci/xunit-plugin/compare/f4820a41b767...4a9dd4c67e95

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: pom.xml src/main/java/org/jenkinsci/plugins/xunit/types/JUnitInputMetric.java src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase1/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase2/result.xml src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase3/input.xml http://jenkins-ci.org/commit/xunit-plugin/4a9dd4c67e95a428f5d9630ac5b4046b42cc91ad Log: Fix JENKINS-18341 Compare: https://github.com/jenkinsci/xunit-plugin/compare/f4820a41b767...4a9dd4c67e95

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              kylewm Kyle Mahan
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: