jhagege
jhagege

Reputation: 1586

Differentiate between xml files in Junit Jenkins plugin

I am running two sets of pytest tests, one for py27 and one for py37 (inside tox framework if it can help)

The test results are saved in two files: test_27.xml and test_37.xml

I'd like to differentiate between the Python versions in the Jenkins interface.
Is there any way to do that with Junit Jenkins plugin ?

Could you think of any workaround ?

Thanks ! enter image description here

Upvotes: 1

Views: 662

Answers (2)

Oliver Bestwalter
Oliver Bestwalter

Reputation: 5397

I don't use Jenkins myself and have no idea what the Junit Jenkins plugin does, but as you mention tox: You can run the two environments in different pipelines running in parallel. They will each have their own reports then. You would define one pipeline calling tox -e py27 and the other calling tox -e py37 and you would have it all neatly separated.

The testenv would look something like this (see substitutions):

[testenv]
commands = pytest --junitxml=junit-{envname}.xml

Each pipeline would have their own reporting step, details about this can be glimpsed from this article by Dave Hunt.

Upvotes: 1

jhagege
jhagege

Reputation: 1586

This is the best solution I found so far: Change pytest testsuite name in xml report

Upvotes: 0

Related Questions