diff --git a/.testr.conf b/.testr.conf index 25d7f8d95..d7b8b32fe 100644 --- a/.testr.conf +++ b/.testr.conf @@ -4,7 +4,7 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ OS_DEBUG=${OS_DEBUG:-0} \ - python -m subunit.run discover . $LISTOPT $IDOPTION + ${PYTHON:-python} -m subunit.run discover . $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index f9f2a6b81..a30316a7e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,5 @@ oslosphinx>=4.7.0 # Apache-2.0 # releasenotes reno>=1.8.0 # Apache-2.0 + +coverage>=4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 4bd24a3f2..fe0a09e21 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ install_command = pip install -U {opts} {packages} deps= -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - python setup.py testr --slowest --testr-args='{posargs}' + python setup.py test --slowest --testr-args='{posargs}' [testenv:pep8] commands = @@ -24,9 +24,10 @@ envdir = {toxworkdir}/venv commands = {toxinidir}/tests/run_functests.sh {posargs} [testenv:cover] -setenv = PYTHON=coverage run --source diskimage_builder -commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi' - bash -c 'testr run --parallel ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET' +# NOTE: this is "setup.py test" (*not* testr) which is a pbr wrapper +# around testr. This understands --coverage-package-name which we +# need due to underscore issues. +commands = python setup.py test --coverage --coverage-package-name diskimage_builder --testr-args='{posargs}' [testenv:docs] commands = python setup.py build_sphinx