Merge lp://qastaging/~duncf/pyjunitxml/cmdline-runner into lp://qastaging/pyjunitxml

Proposed by Duncan Findlay
Status: Merged
Merged at revision: 27
Proposed branch: lp://qastaging/~duncf/pyjunitxml/cmdline-runner
Merge into: lp://qastaging/pyjunitxml
Diff against target: 689 lines (+597/-4)
10 files modified
junitxml/__init__.py (+9/-3)
junitxml/__main__.py (+12/-0)
junitxml/main.py (+167/-0)
junitxml/runner.py (+71/-0)
junitxml/tests/__init__.py (+8/-0)
junitxml/tests/test_junitxml.py (+5/-1)
junitxml/tests/test_main.py (+198/-0)
junitxml/tests/test_runner.py (+119/-0)
pyjunitxml (+7/-0)
setup.py (+1/-0)
To merge this branch: bzr merge lp://qastaging/~duncf/pyjunitxml/cmdline-runner
Reviewer Review Type Date Requested Status
Robert Collins Approve
Review via email: mp+71637@code.qastaging.launchpad.net

Description of the change

Adds support for running unit tests under junitxml directly from the command line. Tests can be specified by name, or (if available) they can be discovered automatically.

This allows for existing unit tests to be run directly by a continuous integration system without needing to write custom wrapper scripts. It also allows for test discovery so that new unit tests can be run without needing to update a wrapper script.

To use, run "python -m junitxml", "python -m junitxml.main" or "python -c 'import junitxml.main;junitxml.main.main()'" (depending on Python version). Tests can be specified by name. If no tests are specified, discovery is used. Discovery is supported for Python >= 2.7 and >= 3.2 or with the unittest2 package installed. Output file can be specified with the -o option (defaults to junit.xml). Number of tests run and final results are also reported on stderr. -h/--help provides a summary of available options (help differs depending on whether discovery is possible).

New code is thoroughly unit tested, and has been tested on Python 2.4, 2.5, 2.6, 2.7, 3.1 and 3.2 with and without unittest2 installed.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Thanks for this, sorry for being slack - RealLife was interfering (new baby). I should get to it soon now.

Revision history for this message
Robert Collins (lifeless) wrote :

Ok, I've reviewed this and it looks fine. Thanks for writing it. I'd like to check that your contribution is also under the LGPL-3 (which the rest of the package is).

If you can confirm that, I'll add appropriate headers to the files and merge it.

Cheers,
Rob

review: Approve
29. By Duncan Findlay

Add pyjunitxml script to avoid the tricky python-version-specific ways of starting junitxml.

Revision history for this message
Duncan Findlay (duncf) wrote :

Added a pending change I had lying around. Turns out when building using many versions of python, having to remember the different ways to start pyjunitxml is annoying, so I added a script to do it, similar to how unittest2 works.

Revision history for this message
Duncan Findlay (duncf) wrote :

On Dec 3, 2011, at 12:07 AM, Robert Collins wrote:
> I'd like to check that your contribution is also under the LGPL-3 (which the rest of the package is).
>
> If you can confirm that, I'll add appropriate headers to the files and merge it.

My contribution is under LGPL-3.

Duncan

Revision history for this message
Robert Collins (lifeless) wrote :

Merged and pushed. Thanks, and thanks for your patience while I got
accustomed to parenthood :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: