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

xUnit plugin does not read maven-surefire-plugin version 2.19 xml file

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Not A Defect
    • xunit-plugin
    • None
    • Jenkins v1.638
      xUnit Plugin v1.98

    Description

      Hi,

      after an update to the new maven-surefire-plugin to version 2.19 the xUnit Plugin does not read the xml file anymore.

      [xUnit] [INFO] - Starting to record.
      [xUnit] [INFO] - Processing JUnit
      [xUnit] [INFO] - [JUnit] - 12 test report file(s) were found with the pattern '/**/surefire-reports/TEST-*.xml' relative to 'D:\JenkinsSlave\workspace\JenkinsConfigurationTest' for the testing framework 'JUnit'.
      [xUnit] [ERROR] - The result file 'surefire-reports\TEST-de.JenkinsConfigurationTest.xml' for the metric 'JUnit' is not valid. The result file has been skipped.
      [xUnit] [INFO] - Failing BUILD because 'set build failed if errors' option is activated.
      [xUnit] [INFO] - There are errors when processing test results.
      [xUnit] [INFO] - Skipping tests recording.
      [xUnit] [INFO] - Stop build.
      

      The new surefire plugin adds two attributes to the testsuite element:

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd"

      Have a look at the attachment for a full example (an extended copy of the testcase1) and may add an simple testcase to the JUnitTypeTest.

          @Test
          public void testTestCase5() throws Exception {
              convertAndValidate(JUnitInputMetric.class, "junit/testcase5/input.xml", "junit/testcase5/input.xml");
          }
      

      This test fails.

      Thanks in advance and greetings from Berlin

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Mirko Friedenhagen
            Path:
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/a8cd8d24b6a5272f2a1aabeda93ae2ca32aab5c1
            Log:
            JENKINS-31553: Parse surefire-2.19.

            Add testcase with input data.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mirko Friedenhagen Path: src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml http://jenkins-ci.org/commit/xunit-plugin/a8cd8d24b6a5272f2a1aabeda93ae2ca32aab5c1 Log: JENKINS-31553 : Parse surefire-2.19. Add testcase with input data.

            Code changed in jenkins
            User: Mirko Friedenhagen
            Path:
            src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/fe963f6c26fba4021feeaa013baef26dd0e6d3f8
            Log:
            JENKINS-31553: Parse surefire-2.19.

            Add testcase with input data.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mirko Friedenhagen Path: src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml http://jenkins-ci.org/commit/xunit-plugin/fe963f6c26fba4021feeaa013baef26dd0e6d3f8 Log: JENKINS-31553 : Parse surefire-2.19. Add testcase with input data.

            This issue in Surefire was introduced with: https://issues.apache.org/jira/browse/SUREFIRE-964.

            mfriedenhagen Mirko Friedenhagen added a comment - This issue in Surefire was introduced with: https://issues.apache.org/jira/browse/SUREFIRE-964 .

            Code changed in jenkins
            User: Mirko Friedenhagen
            Path:
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/f19e07609c3ad8774071a6b73ba29d5ecaae1172
            Log:
            JENKINS-31553: Parse surefire-2.19.

            This would be a format which fixes the issue, I do not see how
            this can easily be solved with Jenkins' xUnit as the XML produced
            by surefire-2.19 is just invalid.
            See https://issues.apache.org/jira/browse/SUREFIRE-964 as well.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mirko Friedenhagen Path: src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml http://jenkins-ci.org/commit/xunit-plugin/f19e07609c3ad8774071a6b73ba29d5ecaae1172 Log: JENKINS-31553 : Parse surefire-2.19. This would be a format which fixes the issue, I do not see how this can easily be solved with Jenkins' xUnit as the XML produced by surefire-2.19 is just invalid. See https://issues.apache.org/jira/browse/SUREFIRE-964 as well.

            I think SUREFIRE-1216 needs to be fixed, then nothing has to be done in the xUnit plugin.

            mfriedenhagen Mirko Friedenhagen added a comment - I think SUREFIRE-1216 needs to be fixed, then nothing has to be done in the xUnit plugin.

            Code changed in jenkins
            User: Mirko Friedenhagen
            Path:
            src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/surefire219/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/dd85d67c3b3485aa5735ec5478849726543312c4
            Log:
            JENKINS-31553: Parse surefire-2.19.

            Use a real TEST file to be sure, only using
            `xsi:noNamespaceSchemaLocation`.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mirko Friedenhagen Path: src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/junit/surefire219/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml http://jenkins-ci.org/commit/xunit-plugin/dd85d67c3b3485aa5735ec5478849726543312c4 Log: JENKINS-31553 : Parse surefire-2.19. Use a real TEST file to be sure, only using `xsi:noNamespaceSchemaLocation`.

            Code changed in jenkins
            User: Mirko Friedenhagen
            Path:
            src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/surefire219/input.xml
            src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml
            http://jenkins-ci.org/commit/xunit-plugin/c8bc038878d9683f595b266f78bf053a831cd444
            Log:
            JENKINS-31553: Parse surefire-2.19.

            Use a real TEST file to be sure, only using
            `xsi:noNamespaceSchemaLocation`.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mirko Friedenhagen Path: src/test/java/org/jenkinsci/plugins/xunit/types/JUnitTypeTest.java src/test/resources/org/jenkinsci/plugins/xunit/types/junit/surefire219/input.xml src/test/resources/org/jenkinsci/plugins/xunit/types/junit/testcase5/input.xml http://jenkins-ci.org/commit/xunit-plugin/c8bc038878d9683f595b266f78bf053a831cd444 Log: JENKINS-31553 : Parse surefire-2.19. Use a real TEST file to be sure, only using `xsi:noNamespaceSchemaLocation`.

            This is not a bug in the XUnit plugin but in surefire, see linked issue SUREFIRE-1216. It will be fixed in the upcoming 2.19.2 release of surefire.

            mfriedenhagen Mirko Friedenhagen added a comment - This is not a bug in the XUnit plugin but in surefire, see linked issue SUREFIRE-1216. It will be fixed in the upcoming 2.19.2 release of surefire.

            People

              gbois Gregory Boissinot
              bernicc Bernard Ladenthin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: