Browse Source

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
changes/99/257899/3
Jim Rollenhagen 6 years ago
committed by John L. Villalovos
parent
commit
b1dfb53ba1
3 changed files with 6 additions and 4 deletions
  1. +1
    -1
      .testr.conf
  2. +1
    -1
      test-requirements.txt
  3. +4
    -2
      tox.ini

+ 1
- 1
.testr.conf 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

+ 1
- 1
test-requirements.txt 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

+ 4
- 2
tox.ini 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]


Loading…
Cancel
Save