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

xunit cannot read junit time attributes with more than three decimals or using exponential notation

XMLWordPrintable

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

      xunit fails to parse junit xml files where the time attribute of the testcase element contains e.g 0.123456 or 1.6e-05, because it very narrowly defines the valid format to decimal notation with no more than three decimals.

       This breaks parsing the junit output from e.g. https://github.com/catchorg/Catch2 as well as an internal unit testing framework with use at my workplace.

      INFO: [JUnit] - 34 test report file(s) were found with the pattern '**/*result.xml' relative to 'foo' for the testing framework 'JUnit'.
      WARNING: The file 'foo/junit-result.xml' is an invalid file.
      WARNING: At line 3 of file:foo/junit-result.xml:cvc-pattern-valid: Value '1.6e-05' is not facet-valid with respect to pattern '(([0-9]{0,3},)*[0-9]{3}|[0-9]{0,3})*(\.[0-9]{0,3})?' for type '#AnonType_timetestsuite'.
      WARNING: At line 3 of file:foo/junit-result.xml:cvc-attribute.3: The value '1.6e-05' of attribute 'time' on element 'testsuite' is not valid with respect to its type, 'null'.
      ERROR: Step ‘Publish xUnit test result report’ aborted due to exception: 

       

            nfalco Nikolas Falco
            tsondergaard tsondergaard
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: