Use stestr as a test runner

This commit makes to use stestr as a test runner instead of testr. This
is aligned to the PTI[0].

[0] https://governance.openstack.org/tc/reference/pti/python.html#python-test-running

Change-Id: Iaddccfeea154cef9b711d11eaea2af30987877de
This commit is contained in:
Masayuki Igawa 2019-06-24 16:26:03 +09:00
parent 0cd475e45e
commit ba3850c60b
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89
5 changed files with 19 additions and 14 deletions

3
.gitignore vendored
View File

@ -25,7 +25,8 @@ pip-log.txt
.coverage .coverage
.tox .tox
nosetests.xml nosetests.xml
.testrepository .stestr/
cover/
# Translations # Translations
*.mo *.mo

2
.stestr.conf Normal file
View File

@ -0,0 +1,2 @@
[DEFAULT]
test_path=./bashate/tests

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

@ -12,7 +12,6 @@ python-subunit>=0.0.18
sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD
openstackdocstheme>=1.11.0 # Apache-2.0 openstackdocstheme>=1.11.0 # Apache-2.0
testrepository>=0.0.18 testtools>=2.2.0
testscenarios>=0.4 stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0
reno!=2.3.1,>=1.8.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0

16
tox.ini
View File

@ -8,9 +8,11 @@ usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
whitelist_externals = *
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:pep8] [testenv:pep8]
basepython = python3 basepython = python3
@ -25,8 +27,16 @@ basepython = python3
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
basepython = python3 setenv =
commands = python setup.py testr --coverage --testr-args='{posargs}' PYTHON=coverage run --source bashate --parallel-mode
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr --test-path ./bashate/tests run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3 basepython = python3