develooper Front page | perl.qa | Postings from June 2011

RE: testsuites element in TAP::Formatter::JUnit reports

Thread Previous | Thread Next
From:
Khai Do
Date:
June 29, 2011 00:46
Subject:
RE: testsuites element in TAP::Formatter::JUnit reports
Message ID:
0055CE69D94919458617273479AB71A9DD4C0FDAE7@MBX7.EXCHPROD.USA.NET
Hello Graham,
I am attempting to aggregate all of my (junit) tap reports and generate a html report using Ant’s junitreport task. However the junitreport task fails with "not a valid testsuite XML document" because the tap reports are not in a standard junit format.  I've also tried using maven to generate html reports and it also fails in the same way.  So yes, the tap xml file is compatible with Jenkins but not ant or maven.  If the 'testsuites' element is removed it will be compatible with all the tools.  Also I think it would look nicer in the Jenkins test reports.    

I entered this bug on your project: https://rt.cpan.org/Public/Bug/Display.html?id=69058
Included is a link to the junit schema and a sample ant project showing the error.

Right now my workaround is exactly as you suggested.  I have an ant task that strips the 'testsuites' element before running generating the html report.

-Khai



-----Original Message-----
From: Graham TerMarsch [mailto:cpan@howlingfrog.com] 
Sent: Sunday, June 26, 2011 10:43 PM
To: perl-qa@perl.org
Cc: Cosimo Streppone; Khai Do
Subject: Re: testsuites element in TAP::Formatter::JUnit reports

On June 25, 2011, Cosimo Streppone wrote:
> On Fri, 24 Jun 2011 20:18:44 +0200, Khai Do <khai.do@impinj.com> wrote:
> > The TAP::Formatter::JUnit formatter isn't creating 100% compatible junit
> > reports. The problem is that the generated reports contain a root level
> > 'testsuites' element which isn't the same as an individual junit report.
> > Junit reports from junit framework only contain 'testsuite' elements.
> 
> I use TAP::Harness::JUnit,
>   
> http://my.opera.com/cstrep/blog/2011/03/08/continuous-integration-of-perl-
> based-projects-in-hudson-jenkins
> 
> but AFAIK that one also builds an XML file with <testsuites> as root
> element.

Yes, both TAP::Harness::JUnit and TAP::Formatter::JUnit generate output with a 
<testsuites> root element, as they're both designed to generate output 
suitable for feeding into a "Hudson/Jenkins" Continuous Integration instance.

Khai, if you specifically need results _without_ that element, could you not 
post-process the output to remove it?  Further, what are you trying to feed 
the JUnit results into?

-- 
Graham TerMarsch

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About