bobber6467 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

builtin XML formatter plugin: --xml --xml-formatter=mymodule.foo #140

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Nose should support XML output of test results.

Use cases:

 * work with nose output in a standard XML format for analysis
   * store test results in a database
   * scrape nosetests output like you might scrape svn output
 * work with nose output in a custom XML format (without having to rely on
XSLT)
   * use nosetests output with continuous integration systems like Bitten,
Bamboo, Cruise Control, etc

Implementation:

A new builtin plugin is needed to allow:

    nosetests --xml

...which would generate XML output of test results in accordance with a schema
definition (preferably Relax-NG schema - http://relaxng.org/).  Nose
documentation will explain the XML schema. 

Additionally, a custom formatter could be used like:

    nosetests --xml --xml-formatter=mymodule.formatters.bitten

...where the formatter argument is any python path pointing to a
module providing a class descending from NoseXMLFormatter (or
something).  This would make supporting custom XML very easy -- no
fussing with setuptools entry points, even.  It would also allow for
separately maintained XML formats to be released as standalone
modules, if the authors felt those would be useful.  Nose documentation
will explain how to build a custom formatter -- what hooks can be
implemented, etc.

Initial discussion:
http://groups.google.com/group/nose-users/browse_thread/thread/85749c41c9ea7ec9/
bb5d1440121ee729

This should address issue111

Original issue reported on code.google.com by kumar.mcmillan on 2 Dec 2007 at 8:30

GoogleCodeExporter commented 8 years ago
I've got an implementation for this plugin posted at: 
http://code.google.com/p/python-nosexml/

For the moment I've just implemented it as an external plugin for ease in 
development. Take a look at and let me 
know if it works for anyone else.

Original comment by paul.jos...@gmail.com on 11 Apr 2008 at 4:27

GoogleCodeExporter commented 8 years ago
Hi Paul.  Sorry for the delay in looking at this -- excellent implementation, 
great
documentation and tests.  I added this to http://nose-plugins.jottit.com/ (feel 
free
to edit the description).

There seemed to be some good arguments for including this in nose core.  I'll 
post
back to the list so we can see what release to fit it into.

Thanks for working on this.

Original comment by kumar.mcmillan on 22 Apr 2008 at 4:24

GoogleCodeExporter commented 8 years ago
I don't know if you're on nose-dev so just a heads up - I'm posting it there.  

Original comment by kumar.mcmillan on 22 Apr 2008 at 4:25

GoogleCodeExporter commented 8 years ago
whoops, incorrectly marked this as Fixed.

Original comment by kumar.mcmillan on 22 Apr 2008 at 4:26

GoogleCodeExporter commented 8 years ago
Tentatively added to 0.11 release plan.

Original comment by jpelle...@gmail.com on 6 Jun 2008 at 6:15

GoogleCodeExporter commented 8 years ago
Paul, great work on the textmate formatter.  Would like to see it in 0.11 for 
that.

You really need some google juice though, as I only found this after cooking up 
my
own version.  Will go and link to you in the hope of saving other people the 
bother.

Original comment by cas...@gmail.com on 4 Sep 2008 at 9:46

GoogleCodeExporter commented 8 years ago
Paul, not sure if you are on this thread for notifications are not.  If so, 
have you
looked into the last few remaining changes that were suggested?  I think they 
were 1)
making the XML capture stderr in <stderr></stderr> tags or something (so the 
xml is
valid) and 2) documentation.  After that it should be ready for 0.11 I think.  

Or ... if casbon or someone else is up for making those changes then that would 
be a
great help.  I can't commit to the work right now myself but if I get some free 
time
I will.

Original comment by kumar.mcmillan on 5 Sep 2008 at 2:25

GoogleCodeExporter commented 8 years ago
I started a work branch for this, 140-xml-plugin, but haven't committed 
anything yet
(d'oh)

Original comment by kumar.mcmillan on 27 Oct 2008 at 5:27

GoogleCodeExporter commented 8 years ago
Update on this: there is an implementation of a basic xunit plugin in nose core 
on
this fork: http://bitbucket.org/kumar303/nose-pycon/
It just needs some more docs, which I am working on, and is scheduled for nose 
0.11

more as it happens.

Original comment by kumar.mcmillan on 1 Apr 2009 at 3:03

GoogleCodeExporter commented 8 years ago

Original comment by jpelle...@gmail.com on 19 Apr 2009 at 3:50

GoogleCodeExporter commented 8 years ago
I'm inclined to say we close this ticket.  The new xunit plugin solves the 
original
problem prompting this ticket:
http://somethingaboutorange.com/mrl/projects/nose/0.11.1/plugins/xunit.html

Having a template to produce other XML outputs would be nice, I guess, but we
shouldn't dwell on it if no one really needs it.

Original comment by kumar.mcmillan on 21 May 2009 at 3:43

GoogleCodeExporter commented 8 years ago
I've just made some changes to the built in cover plugin to take advantage of 
Ned's
recent changes to coverage (cobertura output). If there's interest I can clean 
it up
a bit (i.e. make sure if doesn't break with older versions of coverage) and 
send in a
diff?

Ben

Original comment by ben.for...@gmail.com on 28 Sep 2009 at 10:01

GoogleCodeExporter commented 8 years ago
Ben, I am interested in what you've done. 
Are you going to/have you already sent in the changed code? (And have you 
cleaned it 
up as you said?) Is it in shape to incorporate as a patch before Kumar makes a 
new 
release?

Thanks,
Yitz

(I think that this topic actually deserves to be in a separate thread. Perhaps 
that's why it does not appear that you had any response.)

Original comment by yzur...@nds.com on 10 Nov 2009 at 3:31

GoogleCodeExporter commented 8 years ago
oh whoops, looks like I missed Ben's message.  I'd suggest forking the Nose 
mainline
http://www.bitbucket.org/jpellerin/nose to add the changes to xunit output that
support coverage.

Original comment by kumar.mcmillan on 10 Nov 2009 at 3:55