Migrate to stestr

stestr is actively maintained. OpenStack is migrating to stestr,
go ahead.

Remove the depend on python-subunit as well. stestr takes care of
that for us

Change-Id: I6f845ab4ef1a1c91048666614799a03ab02ab765
This commit is contained in:
Kien Nguyen 2018-03-28 15:21:23 +07:00
parent 988345515a
commit 3d150141b7
6 changed files with 20 additions and 29 deletions

2
.gitignore vendored
View File

@ -27,6 +27,7 @@ cover-master
nosetests.xml nosetests.xml
.testrepository .testrepository
.venv .venv
.stestr
# Translations # Translations
*.mo *.mo
@ -66,3 +67,4 @@ etc/zun/policy.yaml.sample
# etcd config file # etcd config file
devstack/etcd.override devstack/etcd.override

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./zun/tests/unit}
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:-45} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./zun/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -16,9 +16,9 @@ osprofiler>=1.4.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0
PyMySQL>=0.7.6 # MIT License PyMySQL>=0.7.6 # MIT License
tempest>=17.1.0 # Apache-2.0 tempest>=17.1.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testresources>=2.0.0 # Apache-2.0/BSD testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -o pipefail
TESTRARGS=$1
# --until-failure is not compatible with --subunit see:
#
# https://bugs.launchpad.net/testrepository/+bug/1411804
#
# this work around exists until that is addressed
if [[ "$TESTARGS" =~ "until-failure" ]]; then
python setup.py testr --slowest --testr-args="$TESTRARGS"
else
python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f
fi

19
tox.ini
View File

@ -18,8 +18,8 @@ deps = -r{toxinidir}/requirements.txt
commands = commands =
find . -type f -name "*.py[c|o]" -delete find . -type f -name "*.py[c|o]" -delete
rm -rf .testrepository/times.dbm stestr run {posargs}
bash tools/pretty_tox.sh '{posargs}' stestr slowest
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
@ -38,12 +38,20 @@ setenv = PYTHONHASHSEED=0
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = {toxinidir}/tools/cover.sh {posargs} setenv =
{[testenv]setenv}
PYTHON=coverage run --source zun --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs] [testenv:docs]
commands = commands =
doc8 -e .rst specs/ doc/source/ CONTRIBUTING.rst HACKING.rst README.rst doc8 -e .rst specs/ doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
python setup.py build_sphinx sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
[testenv:debug] [testenv:debug]
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
@ -62,7 +70,8 @@ setenv = {[testenv]setenv}
deps = {[testenv]deps} deps = {[testenv]deps}
commands = commands =
find . -type f -name "*.py[c|o]" -delete find . -type f -name "*.py[c|o]" -delete
bash tools/pretty_tox.sh '{posargs}' stestr run {posargs}
stestr slowest
[flake8] [flake8]
filename = *.py,app.wsgi filename = *.py,app.wsgi