Switch tox unit test command to use ostestr

Blatantly plagiarized from I1acc2deadc01421baec256352b35a646676445e5

This commit switches the tox command to use ostestr instead of calling
testr through setup.py. The primary advantage here is that it uses the
subunit-trace output filter. ostestr primarily exists as a replacement
for pretty_tox.sh bash scripts which spread like a plague through
OpenStack projects after Nova copied it from Tempest. (although ostestr
also provides some other useful features) Granted ironic wasn't using
that, but this commit makes the switch to enable getting the
subunit-trace output which is generally useful.

Note that this dramatically increases output while running tests.
However, test failures are still at the bottom of the output, so it
shouldn't cause much pain, if any.

Change-Id: Ia373b9b4857824644e99a2c8d27e64018cb84b78
This commit is contained in:
Jim Rollenhagen 2015-12-15 05:43:32 -08:00 committed by John L. Villalovos
parent 5751b32932
commit b1dfb53ba1
3 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./ironicclient/tests/unit} $LISTOPT $IDOPTION
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ ${TESTS_DIR:-./ironicclient/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -13,6 +13,6 @@ oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
python-subunit>=0.0.18
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
testrepository>=0.0.18
testtools>=1.4.0
tempest-lib>=0.11.0
os-testr>=0.4.1

View File

@ -6,13 +6,15 @@ skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
# .testr.conf uses TESTS_DIR
TESTS_DIR=./ironicclient/tests/unit
usedevelop = True
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}'
ostestr {posargs}
[testenv:pep8]
commands =
@ -29,7 +31,7 @@ commands =
commands = {posargs}
[testenv:functional]
setenv = OS_TEST_PATH=./ironicclient/tests/functional
setenv = TESTS_DIR=./ironicclient/tests/functional
LANGUAGE=en_US
[flake8]