Switch to use stestr as the default test runner

This commit switches from using the pbr testr wrapper script to use
stestr as the test runner.

Change-Id: I42c4a14d9e4366a621129d2c158fe57a8fc4b30e
This commit is contained in:
Matthew Treinish 2017-09-20 14:27:01 -04:00
parent 0af64c7c00
commit 0c03474288
5 changed files with 18 additions and 11 deletions

View File

@ -28,6 +28,7 @@ cover/
.tox
nosetests.xml
.testrepository
.stestr
.venv
# Translations
@ -55,4 +56,4 @@ ChangeLog
.*sw?
# Files created by releasenotes build
releasenotes/build
releasenotes/build

View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./{{cookiecutter.module_name}}/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

@ -8,7 +8,7 @@ coverage>=4.0,!=4.4 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx>=1.6.2 # BSD
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0 # MIT
openstackdocstheme>=1.11.0 # Apache-2.0
# releasenotes

View File

@ -9,8 +9,11 @@ install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstac
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
commands = stestr run {posargs}
[testenv:pep8]
commands = flake8 {posargs}
@ -19,7 +22,14 @@ commands = flake8 {posargs}
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source {{ cookiecutter.module_name }} --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
commands = python setup.py build_sphinx