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

xUnit only calculates success for and reports results for single file when multiple are specified.

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • xunit-plugin
    • xunit 1.96 & 1.101, Java 1.7, Jenkins 1.624

      I have added a post-build action called Publish xUnit test result report, I have then added a JUnit sub-section and specified the paths to my xml files. I know that xUnit is finding all of the specified files ([xUnit] [INFO] - [JUnit] - 3 test report file(s) were found with the pattern) however xUnit proceeds to base the success of the build on only one of the files and Latest Build Results also shows the breakdown of the tests from the same single file.

      If I only specify a single file, I can get xUnit to correctly calculate the build success and display all three of the files individually.

      When I specify multiple files only the first file is used.

      How do I get xUnit to combine the output of all three files and present them individually?

      I have tried:

      • Appending all test results into a single file, This leads to the XML being badly formed and unparseable.
      • Adding multiple JUnit sub-sections (one for each file), This is no different to normal, only the first specified file is used to report success and display results.

          [JENKINS-33248] xUnit only calculates success for and reports results for single file when multiple are specified.

          Each of the files has

          <testsuite name="all tests"...>
          

          where the name is the same for all of the testsuites, I'm as yet unable to test what happens when the names are different, however this is currently my only lead.

          Sebastian Troy added a comment - Each of the files has <testsuite name= "all tests" ...> where the name is the same for all of the testsuites, I'm as yet unable to test what happens when the names are different, however this is currently my only lead.

          Nikolas Falco added a comment -

          I had try your scenario.

          I used only JUnit report type. The specified pattern was "path1/.xml, path2/.xml, path3/*.xml", where in path1 and path2 there was report with no failures, indeed in the path2 there was a 2 test and 1 failure.

          I setup the "Failed Tests" threshold with "Total" 0 and I got the build status FAILURE as expected.

          Keep in mind that if you do not setup any values (you leave them blanks) in "Failed Tests" threshold build will not fails.

          Nikolas Falco added a comment - I had try your scenario. I used only JUnit report type. The specified pattern was "path1/ .xml, path2/ .xml, path3/*.xml", where in path1 and path2 there was report with no failures, indeed in the path2 there was a 2 test and 1 failure. I setup the "Failed Tests" threshold with "Total" 0 and I got the build status FAILURE as expected. Keep in mind that if you do not setup any values (you leave them blanks) in "Failed Tests" threshold build will not fails.

            nfalco Nikolas Falco
            troyseph Sebastian Troy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: