I would like to use different command line arguments for py.test, depending on environment: running locally there should be only default ones, but on Jenkins I would like to add --junitxml=junit-{envname}.xml
, so the test results could be published in nice format.
I know from documentation, that there is special [tox:jenkins]
section, which should be used in case there is defined 'JENKINS_URL'
or 'HUDSON_URL'
. So now I created simple tox.ini file:
[tox]
envlist = py27, py35
[tox:jenkins]
commands = echo "We are in JENKINS!"
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/my_module
commands = python setup.py test
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_test.txt
And have defined JENKINS_URL
environment variable:
export JENKINS_URL=true
I expect, that if I run tox, then my original command will be substituted with echo
, but it doesn't work, instead I end with original command been executed.
Could someone help me with this problem?