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

JUnit Test Report parsed incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • junit-plugin
    • None
    • Platform: All, OS: All

      The current version (1.171) has a problem parsing the following JUnit report file:

      <?xml version="1.0" encoding="UTF-8" ?>
      <testsuites>
      <testsuite errors="0" failures="0"
      hostname="archbuild" id="0"
      name="StudioAllTests"
      package="test.infor.clearux.studio.integration" tests="456"
      time="107.824" timestamp="2008-01-23T10:49:26">

      <testcase classname="test.foo.bar.DefaultIntegrationTest"
      name="experimentsWithJavaElements" time="0.0" />
      <testcase classname="test.foo.bar.BundleResolverIntegrationTest"
      name="testGetBundle" time="0.0" />
      <testcase classname="test.foo.bar.BundleResolverIntegrationTest"
      name="testGetBundleLocation" time="0.656" />
      <testcase classname="test.foo.bar.ProjectSettingsTest"
      name="testNatureAddition" time="0.125" />
      <testcase classname="test.foo.bar.ProjectSettingsTest"
      name="testNatureRemoval" time="0.11" />
      </testsuite>
      </testsuites>

      The file is produces using the Junit ant task. Note, in this file the
      <properties> element is omitted for clarity.

      In 1.132 this file will produce this kind of output:

      <?xml version='1.0' encoding='UTF-8'?>
      <result>
      <suites>
      <suite>
      <cases>
      <case>
      <className>test.foo.bar.DefaultIntegrationTest</className>
      <testName>experimentsWithJavaElements</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <className>test.foo.bar.BundleResolverIntegrationTest</className>
      <testName>testGetBundle</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <className>test.foo.bar.BundleResolverIntegrationTest</className>
      <testName>testGetBundleLocation</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <className>test.foo.bar.ProjectSettingsTest</className>
      <testName>testNatureAddition</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <className>test.foo.bar.ProjectSettingsTest</className>
      <testName>testNatureRemoval</testName>
      <failedSince>0</failedSince>
      </case>
      </cases>
      </suite>
      </suites>
      </result>

      In version 1.171 this will look like this :

      <?xml version='1.0' encoding='UTF-8'?>
      <result>
      <suites>
      <suite>
      <name>(test.foo.bar.AllTests.xml)</name>
      <duration>101.90081</duration>
      <cases>
      <case>
      <duration>0.0</duration>
      <className>(test.foo.bar.AllTests.xml)</className>
      <testName>experimentsWithJavaElements</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <duration>0.016</duration>
      <className>(test.foo.bar.AllTests.xml)</className>
      <testName>testGetBundle</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <duration>0.797</duration>
      <className>(test.foo.bar.AllTests.xml)</className>
      <testName>testGetBundleLocation</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <duration>0.125</duration>
      <className>(test.foo.bar.AllTests.xml)</className>
      <testName>testNatureAddition</testName>
      <failedSince>0</failedSince>
      </case>
      <case>
      <duration>0.093</duration>
      <className>(test.foo.bar.AllTests.xml)</className>
      <testName>testNatureRemoval</testName>
      <failedSince>0</failedSince>
      </case>
      </cases>
      </suite>
      </suites>
      <duration>101.90081</duration>
      </result>

      Note, how the new version is using the file name surrounded with parentheses
      instead of the actual test class.

      I have posted the question on the mail list and Kohsuke suggested to file a
      defect. Here is the mailing list link :
      https://hudson.dev.java.net/servlets/ReadMsg?list=users&msgNo=6603

      • Stefan

            Unassigned Unassigned
            s_baramov s_baramov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: