Package name is always "(root)" viewing test results

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Package name is always "(root)" viewing test results

Neil Bird

   Using what I believe is the default Jenkins test-results viewer, nomatter
what I put into my JUnit XML as the testsuite packagename, the results
always appear under a single package called “(root)”.

   I've tried splitting the results (packages) up into diff. xml files, but
it still collates them under (root).

   Am I doing something wrong?


   E.g.:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
     <testsuite id="0" package="MyPackage" name="SomeName"
timestamp="2011-10-12T11:46:46" hostname="host" tests="8" time="123"
errors="0" failures="0">
...
(with multiple testsuites for differing packages)


--
[neil@fnx ~]# rm -f .signature
[neil@fnx ~]# ls -l .signature
ls: .signature: No such file or directory
[neil@fnx ~]# exit

Reply | Threaded
Open this post in threaded view
|

Re: Package name is always "(root)" viewing test results

Simon Wiest
Hi Neil,

to my knowledge, there's no official specification of the JUnit XML file
format - so unfortunately, every tool seems to talk a dialect of its
own... ;O(

In case of Jenkins, an attribute 'package' of the 'testsuite' element is
ignored as far as I know. Instead you can use a fully qualified class
name in the 'classname' attribute of the embedded 'testcase' element,
e.g. classname="MyPackage.SomeName". Jenkins will process anything left
from the last dot as a package prefix.

Does this work for you?

Cheers,
Simon.
--
Neil Bird wrote (12.10.2011 15:30):

> Using what I believe is the default Jenkins test-results viewer,
> nomatter what I put into my JUnit XML as the testsuite packagename, the
> results always appear under a single package called “(root)”.
>
> I've tried splitting the results (packages) up into diff. xml files, but
> it still collates them under (root).
>
> Am I doing something wrong?
>
> E.g.:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <testsuites>
> <testsuite id="0" package="MyPackage" name="SomeName"
> timestamp="2011-10-12T11:46:46" hostname="host" tests="8" time="123"
> errors="0" failures="0">
> ...
> (with multiple testsuites for differing packages)
Reply | Threaded
Open this post in threaded view
|

Re: Package name is always "(root)" viewing test results

Neil Bird
Around about 12/10/11 19:01, Simon Wiest typed ...
> In case of Jenkins, an attribute 'package' of the 'testsuite' element is
> ignored as far as I know. Instead you can use a fully qualified class name
> in the 'classname' attribute of the embedded 'testcase' element, e.g.
> classname="MyPackage.SomeName". Jenkins will process anything left from the
> last dot as a package prefix.

   Excellent, yes, that does the trick!  Thanks!

--
[neil@fnx ~]# rm -f .signature
[neil@fnx ~]# ls -l .signature
ls: .signature: No such file or directory
[neil@fnx ~]# exit