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

xUnit fails to parse PHPUnit output when a skipped test also has system output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • xunit-plugin
    • None

      I'm using the latest version of the xUnit plugin (2.3.3) with the PHPUnit-3.x parser. It fails on a few tests because it can't parse the xml file, and it gives a somewhat misleading error:

      WARNING: The file 'myresult.xml' is an invalid file.
      WARNING: At line 7261 of file:myresult.xml:cvc-complex-type.2.4.d: Invalid content was found starting with element 'system-out'. No child element is expected at this point.
      FATAL: The result file 'myresult.xml' for the metric 'PHPUnit' is not valid. The result file has been skipped.

      This seems to be happening because the test was skipped, but still had system output. Here's an example:

      <testcase name="testMyTest" class="MyTestUnitTest" file="myUnitTest.php" line="320" assertions="157" time="45.286155">
          <skipped />
          <system-out>Some debug info...</system-out>
      </testcase>

      In this case there's a bunch of setup happening in the base class before the test even runs (which will ultimately be skipped), which is echoing out debug information. This system output is useful for debugging, and inconsequential to the result of the tests. I can alter my tests to not output anything, but parsing shouldn't fail here, or should at least produce a meaningful error message.

            nfalco Nikolas Falco
            captain_hypertext Captain Hypertext
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: