Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jpellerin opened this issue Dec 14, 2011 · 14 comments
Open

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

jpellerin opened this issue Dec 14, 2011 · 14 comments
Assignees

Comments

@jpellerin
Copy link
Member

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

Google Code Info:
Issue #: 140
Author: kumar.mcmillan
Created On: 2007-12-02T20:30:52.000Z
Closed On:

@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: [email protected]
Created On: 2008-04-11T16:27:46.000Z

@ghost ghost assigned jpellerin Dec 14, 2011
@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: kumar.mcmillan
Created On: 2008-04-22T04:24:31.000Z

@jpellerin
Copy link
Member Author

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

Google Code Info:
Author: kumar.mcmillan
Created On: 2008-04-22T04:25:59.000Z

@jpellerin
Copy link
Member Author

whoops, incorrectly marked this as Fixed.

Google Code Info:
Author: kumar.mcmillan
Created On: 2008-04-22T04:26:19.000Z

@jpellerin
Copy link
Member Author

Tentatively added to 0.11 release plan.

Google Code Info:
Author: [email protected]
Created On: 2008-06-06T18:15:03.000Z

@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: [email protected]
Created On: 2008-09-04T09:46:36.000Z

@jpellerin
Copy link
Member Author

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 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.

Google Code Info:
Author: kumar.mcmillan
Created On: 2008-09-05T02:25:36.000Z

@jpellerin
Copy link
Member Author

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

Google Code Info:
Author: kumar.mcmillan
Created On: 2008-10-27T17:27:10.000Z

@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: kumar.mcmillan
Created On: 2009-04-01T15:03:55.000Z

@jpellerin
Copy link
Member Author

Google Code Info:
Author: [email protected]
Created On: 2009-04-19T15:50:35.000Z

@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: kumar.mcmillan
Created On: 2009-05-21T15:43:47.000Z

@jpellerin
Copy link
Member Author

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

Google Code Info:
Author: [email protected]
Created On: 2009-09-28T10:01:48.000Z

@jpellerin
Copy link
Member Author

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.)

Google Code Info:
Author: [email protected]
Created On: 2009-11-10T15:31:37.000Z

@jpellerin
Copy link
Member Author

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.

Google Code Info:
Author: kumar.mcmillan
Created On: 2009-11-10T15:55:23.000Z

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

No branches or pull requests

1 participant