Update test tool to use stestr

testrepository isn't maintained at this point but stestr is. Switch to
stestr.

Change-Id: I545cb1598cd232220aa4b61d0155ab5a2846fd29
This commit is contained in:
Clark Boylan 2021-11-18 08:32:11 -08:00
parent c4c2bf1afe
commit 818227c23f
5 changed files with 18 additions and 11 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ pip-log.txt
.tox .tox
nosetests.xml nosetests.xml
.testrepository .testrepository
.stestr
.venv .venv
# Translations # Translations

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=bindep/tests
top_dir=./

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

@ -2,5 +2,5 @@ coverage>=3.6
fixtures>=0.3.12 fixtures>=0.3.12
mock>=2.0 # BSD mock>=2.0 # BSD
python-subunit python-subunit
testrepository>=0.0.13 stestr>=1.0.0 # Apache-2.0
testtools>=0.9.27 testtools>=0.9.27

16
tox.ini
View File

@ -9,9 +9,12 @@ usedevelop = True
basepython = python3 basepython = python3
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = commands =
python setup.py test --slowest --testr-args='{posargs}' stestr run {posargs}
stestr slowest
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3
@ -23,7 +26,14 @@ commands = flake8
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}' setenv =
{[testenv]setenv}
PYTHON=coverage run --source bindep --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs] [testenv:docs]
deps = deps =