Replace testr with stestr

os-testr 1.0.0 now uses stestr as underlying test runner,
so we should re-configure our testing setup accordingly.

Change-Id: I0a8f23cf2bd934c288daf1a9fa8b672768641163
This commit is contained in:
Pavlo Shchelokovskyy 2017-10-06 07:14:27 +00:00
parent a283a3ed58
commit 60e0ea26fb
4 changed files with 12 additions and 10 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ develop-eggs
# Other
*.DS_Store
.stestr
.testrepository
.tox
.idea

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${TESTS_DIR:-./ironicclient/tests/unit}
top_dir=./

View File

@ -1,5 +0,0 @@
[DEFAULT]
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

11
tox.ini
View File

@ -7,7 +7,7 @@ skipsdist = True
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
LANGUAGE=en_US
# .testr.conf uses TESTS_DIR
# .stestr.conf uses TESTS_DIR
TESTS_DIR=./ironicclient/tests/unit
usedevelop = True
install_command =
@ -27,11 +27,14 @@ commands =
doc8 doc/source CONTRIBUTING.rst README.rst
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
setenv = {[testenv]setenv}
PYTHON=coverage run --source ironicclient --omit='*tests*' --parallel-mode
commands =
coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
ostestr {posargs}
coverage combine
coverage report --omit='*tests*'
coverage html -d ./cover --omit='*tests*'
[testenv:venv]
commands = {posargs}