• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • junit-plugin
    • Jenkins 1.638 JUnit plugin 1.9 xUnit plugin 1.98 Ubuntu 14.04 nose 1.3.7

      I am using `nose` to generate xunit test result files. With the option `--xunit-testsuite-name=<NAME>` (https://nose.readthedocs.org/en/latest/plugins/xunit.html#cmdoption--xunit-testsuite-name) it sets the `name` attribute in the `testsuite` tag to a custom value instead of the default value `nosetests`). The following is an example result file - note the `name` attribute in the root tag:

      <testsuite name="great_name_to_group_all_these_testcases" tests="2" errors="0" failures="0" skip="0">
        <testcase classname="test.test_something.FooTest" name="test_foo" time="0.001"></testcase>
        <testcase classname="test.test_something.BarTest" name="test_bar" time="0.001"></testcase>
      </testsuite>
      

      Currently the xunit plugin (I am using the JUnit repor) does not use the `name` attribute of the `testsuite` tag anywhere. The hierarchy of the test results is built only based on the `classname` of the `testcase` tag. If multiple result files contain testcases it is not clear to which result file they belong.

      It would be very helpful if the hierarchy would also include the `name` attribute of the `testsuite` tag to build the hierarchy. This would group the testcases from each testsuite more reasonable.

      Please let me know if I can provide any more information.

          [JENKINS-31699] use testsuite name to built hierachy

          Nikolas Falco added a comment -

          How the job report is generated depends by the junit-plugin.

          xUnit plugin just prepare reports in the form of JUnit XML and give them as input to the junit-plugin.

          Anyway I can say that report is generated as expected since the testsuite is just a container to group single unit test classes. A unit test could be included in more test suites. A TestSuite is mainly used to make a setup and teardown common to all unit test or to orders them execution.

          For example the JUnitReport ant task does the same, it groups unit test by package and the name of the testcases as children.

          Nikolas Falco added a comment - How the job report is generated depends by the junit-plugin. xUnit plugin just prepare reports in the form of JUnit XML and give them as input to the junit-plugin. Anyway I can say that report is generated as expected since the testsuite is just a container to group single unit test classes. A unit test could be included in more test suites. A TestSuite is mainly used to make a setup and teardown common to all unit test or to orders them execution. For example the JUnitReport ant task does the same, it groups unit test by package and the name of the testcases as children.

            Unassigned Unassigned
            dthomas Dirk Thomas
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: