Switch to stestr

It works better and pbr will at some point drop support for running
tests via setup.py.

Change-Id: I44250d8c65af932e035c7ab6fc08f1135a15ab93
This commit is contained in:
Ben Nemec 2019-04-24 17:19:00 +00:00 committed by Natal Ngétal
parent 58f2b47814
commit e27bb7efdb
5 changed files with 16 additions and 12 deletions

3
.gitignore vendored
View File

@ -27,8 +27,7 @@ pip-log.txt
# Unit test / coverage reports # Unit test / coverage reports
.coverage .coverage
.tox .tox
nosetests.xml .stestr
.testrepository
# Translations # Translations
*.mo *.mo

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./reviewstats/tests
top_path=./

View File

@ -1,7 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -3,7 +3,9 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage>=3.6 coverage>=3.6
fixtures>=0.3.14 fixtures>=0.3.14
python-subunit python-subunit
testrepository>=0.0.17 sphinx>=1.1.2,<1.2
oslo.sphinx
stestr>=2.0.0
testscenarios>=0.4,<0.5 testscenarios>=0.4,<0.5
testtools>=0.9.32 testtools>=0.9.32
mock mock

11
tox.ini
View File

@ -10,7 +10,7 @@ setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}' commands = stestr run --slowest {posargs}
[testenv:docs] [testenv:docs]
basepython = python3 basepython = python3
@ -24,7 +24,14 @@ commands = flake8
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}' commands =
coverage erase
{[testenv]commands}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --show-missing
[flake8] [flake8]
show-source = True show-source = True