JUnit XML "packages" in hudson

I am creating XML myself that is similar enough to JUnit for Hudson to read them. It works fine, but I can't figure out what a list of packages is in the Hudson web interface. How to make XML that will interpret Hudson as a "package?"

<testsuites>
<testsuite>

  <testcase classname="class\name\that\is\really\folders" name="test_name.log" time="231">
  </testcase>
</testsuite>
</testsuites>

Hudson will list this as:

Package: (root)
Class: class \ name \ that \ is \ really \ folders
Test name: test_name.log

+5
source share
3 answers

I think Jenkins takes the package name from the name attribute in the testuite tag. You can try changing your XML as follows

<testsuites>
<testsuite name="package.name.of.your.testclass">

  <testcase classname="class\name\that\is\really\folders" name="test_name.log" time="231">
  </testcase>
</testsuite>
</testsuites>
+1
source

@pushy - I tried this before, but when I tried to prove that you were wrong, I got it this time ;-).

<testsuites>
<testsuite name="package.name.of.your.testclass">

  <testcase classname="package.name.of.your.testclass.class\name\that\is\really\folders" name="test_name.log" time="231">
  </testcase>
</testsuite>
</testsuites>

testuite "".

+6

No redundancy needed! Jenkins beautifully describes package and class names if you:

  • use attribute nameinsteadclassname
  • make sure the <testsuite>element attribute namehas at least two separated by a dot with delimiters. Now all nested elements <testcase>will receive the package and class. The last part will be the class name. The rest will be the package name.

Like this:

<testsuites>
    <testsuite name="packagename.classname">
      <testcase name="test_name.log" time="231"></testcase>
    </testsuite>
</testsuites>
+2
source

All Articles