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

jUnit output of PHPUnit test fail to parse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.127
      xUnit plugin 2.0.2
    • Similar Issues:

      Description

      Job log show lots of error lines starting like:

      INFO: [JUnit] - 2 test report file(s) were found with the pattern 'phpunit-result.xml, selenium.xml' relative to '/var/lib/jenkins/workspace/bob-develop' for the testing framework 'JUnit'.
       WARNING: The file '/var/lib/jenkins/workspace/bob-develop/phpunit-result.xml' is an invalid file.
       WARNING: At line 3 of file:/var/lib/jenkins/workspace/bob-develop/phpunit-result.xml:cvc-complex-type.3.2.2: Attribute 'assertions' is not allowed to appear in element 'testsuite'

      I can supply a full XML file if needed.

        Attachments

          Issue Links

            Activity

            Hide
            nfalco Nikolas Falco added a comment -

            Assertions is not a valid attribute for the testsuite element of supported JUnit report.
            The managed scenarios are errors, failure and skipped What assertions means?

            If you would support the custom junit format for phpunit test please select the "Custom Tool" as test type and provide an XSL to conver the generated report to a correct format of the supported JUnit format. In the "custom stylesheet" value you could insert the path of your XSL file that could be absolute on the server (master) or relative to the workspace.

            Show
            nfalco Nikolas Falco added a comment - Assertions is not a valid attribute for the testsuite element of supported JUnit report. The managed scenarios are errors, failure and skipped What assertions means? If you would support the custom junit format for phpunit test please select the "Custom Tool" as test type and provide an XSL to conver the generated report to a correct format of the supported JUnit format. In the "custom stylesheet" value you could insert the path of your XSL file that could be absolute on the server (master) or relative to the workspace.
            Hide
            nfalco Nikolas Falco added a comment -

            Consider to use the internal PHPUnit support instead of leave PHP to produce a compatible report.

            Show
            nfalco Nikolas Falco added a comment - Consider to use the internal PHPUnit support instead of leave PHP to produce a compatible report.
            Hide
            larsskj Lars Skjærlund added a comment -

            It did work with xUnit 1.X though. I think you should provide a very clear warning when you break backwards compatibility - and provide a way to keep the old version until we've had a chance to resolve the issue. The 1.X -> 2.X upgrade has broken a lot of existing functionality.

            Show
            larsskj Lars Skjærlund added a comment - It did work with xUnit 1.X though. I think you should provide a very clear warning when you break backwards compatibility - and provide a way to keep the old version until we've had a chance to resolve the issue. The 1.X -> 2.X upgrade has broken a lot of existing functionality.
            Hide
            nfalco Nikolas Falco added a comment -

            As you suggest I mark the plugin to show a warning since version 2.0 and a clear message in the wiki page.

            Show
            nfalco Nikolas Falco added a comment - As you suggest I mark the plugin to show a warning since version 2.0 and a clear message in the wiki page.
            Hide
            captain_hypertext Captain Hypertext added a comment -

            Yeah, this issue completely butchered my unit test parsing.  I switched to the PHPUnit-X parser and it worked pretty well, still using JUnit output.

            Show
            captain_hypertext Captain Hypertext added a comment - Yeah, this issue completely butchered my unit test parsing.  I switched to the PHPUnit-X parser and it worked pretty well, still using JUnit output.

              People

              Assignee:
              nfalco Nikolas Falco
              Reporter:
              larsskj Lars Skjærlund
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: