Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine test results from two different nosetests?

I need to run nosetests on 2 packages seperately. For example:

nosetests --with-xunit --xunit-file=sample.xml test_sample.py

and

nosetests --with-xunit --xunit-file=sample1.xml test_sample1.py

Now how can I combine sample.xml and sample1.xml files?

Is there any command to do that? I need a combined test result file in xml so that I can use that file in jenkins configuration.

like image 790
Manjunath Patil Avatar asked Feb 27 '14 04:02

Manjunath Patil


2 Answers

You can have multiple test result (sample.xml and sample1.xml) in jenkins. Just set Publish JUnit test result report\Test report XMLs to select all xml reports with **/*.xml, and generate your xml output within your workspace, something like:

nosetests --with-xunit --xunit-file=%WORKSPACE%\\sample.xml test_sample.py
nosetests --with-xunit --xunit-file=%WORKSPACE%\\sample1.xml test_sample1.py
like image 146
Oleksiy Avatar answered Oct 16 '22 00:10

Oleksiy


You can use the xunitmerge package to do this.

xunitmerge sample.xml sample1.xml merged.xml
like image 4
George Whewell Avatar answered Oct 16 '22 00:10

George Whewell