Write a formatter for Jenkins/JUnit #158

Closed
schwern opened this Issue Nov 1, 2011 · 7 comments

Projects

None yet

4 participants

@schwern
Member
schwern commented Nov 1, 2011

Write a formatter which outputs the JUnit XML which Jenkins consumes. I expect it will be the most popular format after TAP. It will exercise the flexibility of the formatter.

Schemas to work from can be found here: http://stackoverflow.com/questions/442556/spec-for-junit-xml-output

See Test::Builder2::Formatter and Test::Builder2::EventWatcher for details about writing a formatter. Test::Builder2::TAP::v13 is currently the most fleshed out.

@leto
leto commented Nov 1, 2011

Jenkins supports TAP. Just sayin'

@Ovid
Ovid commented Nov 1, 2011

jUnit schema:

http://jra1mw.cvs.cern.ch:8180/cgi-bin/jra1mw.cgi/org.glite.testing.unit/config/JUnitXSchema.xsd?view=markup

This has a simple template at the bottom showing output:

https://metacpan.org/source/JFRIED/Rex-0.21.1/lib/Rex/Output/JUnit.pm

A failure report example:

http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo

Cheers,

Ovid

Live and work overseas - http://overseas-exile.blogspot.com/
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://blogs.perl.org/users/ovid/
Twitter - http://twitter.com/OvidPerl/

----- Original Message -----

From: Michael G. Schwern reply@reply.github.com
To: Ovid ovid@cpan.org
Cc:
Sent: Tuesday, 1 November 2011, 4:01
Subject: [test-more] Write a formatter for Jenkins/JUnit (#158)

Write a formatter which outputs the JUnit XML which Jenkins consumes.  I expect
it will be the most popular format after TAP.  It will exercise the flexibility
of the formatter.

First problem is figuring out what that format is.  I can't find
documentation for it.  Might have to dig into either Jenkins or JUnit to find
out.

See Test::Builder2::Formatter and Test::Builder2::EventWatcher for details about
writing a formatter.  Test::Builder2::TAP::v13 is currently the most fleshed
out.

Reply to this email directly or view it on GitHub:
#158

@schwern
Member
schwern commented Nov 1, 2011

@leto Yes. TAP and JUnit output different types of information, so it would be nice if our tests could feed Jenkins the details it wants. It also means Perl devs don't have to go begging to the Jenkins admin to install a plugin. In addition, there are other tools which speak JUnit it would be nice to talk to. Finally, it will be an excellent test for the flexibility of the system.

@ovid Thanks for the links!

@dolmen
dolmen commented Nov 18, 2011

Note that the XSD file says "XML Schema for XUnit tests output".
XUnit, not JUnit as this format is language agnostic (or acmeist).

I find TAP output more useful because it has TODO, which XUnit lacks.

@schwern
Member
schwern commented Nov 18, 2011

@dolmen Thanks, but this isn't a format debate.

I don't understand your point about the XSD file. If it's relevant to implementing a [JX]Unit formatter, could you explain?

@dolmen
dolmen commented Nov 19, 2011

My point is only about the naming of the formatter plugin.

@schwern
Member
schwern commented Nov 19, 2011

@dolmen I don't believe the XSD file that Ovid posted is definitive. In fact, I don't think there is a definitive XUnit/JUnit XML schema. The best I've seen is what Ant outputs.
http://stackoverflow.com/questions/442556/spec-for-junit-xml-output

Most everything I read refers to it as the JUnit XML schema. Jenkins does and so does Ant. It's cross-language no matter what we call it, so it's best to name it by the name people expect.

@schwernbot schwernbot referenced this issue in Test-More/TB2 Mar 16, 2014
Open

Write a formatter for Jenkins/JUnit #27

@schwern schwern closed this Mar 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment