How could trial
output be converted to JUnit xml format? There is no such possible report format in trial
.
$> trial --help-reporters
Trial's output can be customized using plugins called Reporters. You can
select any of the following reporters using --reporter=<foo>
subunit subunit output
bwverbose Colorless verbose output
text terse text output
verbose verbose color output (default reporter)
timing Timing output
summary minimal summary output
I had a hard time with this. Turns out subunit has a new version 2 of it's protocol, and that's what the version of subunit2junitxml was expecting. See https://pypi.python.org/pypi/python-subunit
I had to pipe the results of trial through the subunit-1to2 filter before piping to subunit2junitxml. So the command I ended up with is:
trial --reporter=subunit <mypackage> | subunit-1to2 | subunit2junitxml --no-passthrough --output-to=$WORKSPACE/temp/output.xml
Hope this helps someone.
The simplest way to do it is by setting the reporter of trial to be subunit and then convert the output to JUnit via the subunit2junitxml
found in subunit (under the filters folder in trunk).
For example we do:
trial --reporter=subunit | subunit2junitxml --forward --output-to=junitxml-result.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With