Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

JUnit Formatter to provide test results for Jenkins #42

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

arifken
Copy link

@arifken arifken commented Oct 25, 2013

This branch includes a new formatter class to output XML that can be consumed by Jenkins and shown in the "test results" graph.

In order to do this, I also had to make a small change to Formatter.on, so that the instance of the formatter is passed to the block.

I also added a spec for the new JUnitFormatter

-Andy

@listrophy
Copy link
Contributor

Gonna get a little pedantic here... sorry in advance.

I don't think this qualifies as a formatter in the current sense within bwoken. Formatters basically filter instruments(1)'s output into something else that gets sent to stdout. This JUnit formatter, OTOH, has the main function of writing to a different file.

To me, that means it's like a formatter, but not exactly a formatter. What is it? I dunno... maybe a diverter? It kinda acts like tee(1) in that sense.

Anyway, I see two ways to go about this:

  1. We make this formatter output the JUnit XML to stdout. It's then up to you to redirect that output to wherever you want.
  2. We create a new class of plugins to bwoken that are allowed to peer into the output pipeline, but don't modify it. Maybe enable this particular feature with --junit. If you needed both JUnit and XUnit output, you could simply do bwoken test --junit --xunit and get back the standard colorful output with two files in your integration/results directory.

Thoughts?

@arifken
Copy link
Author

arifken commented Nov 4, 2013

I like the second option. I agree, I think there needs to be a separate mechanism aside from formatters (maybe we call these "reporters"?) that can be added as extensions to bwoken. These tools should generate output files that can be read by various CI tools. If you like, I can take a stab at implementing an interface and base class "reporter," and then add this module as "JUnitReporter"

@otusweb
Copy link

otusweb commented Jan 24, 2014

arifken, do you have a repo with this built on top of the 2.0 release. i'm looking to run my test in Jenkins too.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants