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

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

XMLWordPrintable

      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.

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

              Created:
              Updated:
              Resolved: