Switch to stestr

According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I55060b1d99b9a00b20c98fbb429d072568265695
This commit is contained in:
Vu Cong Tuan 2018-07-12 15:23:08 +07:00
parent 2e6ef0c45a
commit 32a3244bb4
7 changed files with 16 additions and 41 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
.coverage
.venv
.testrepository
.stestr/
subunit.log
.tox
*,cover

3
.stestr.conf Normal file
View File

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

View File

@ -48,7 +48,6 @@ netifaces==0.10.4
openstacksdk==0.11.2
os-client-config==1.28.0
os-service-types==1.2.0
os-testr==1.0.0
osc-lib==1.8.0
oslo.concurrency==3.25.0
oslo.config==5.2.0
@ -96,11 +95,10 @@ simplejson==3.5.1
six==1.10.0
smmap==0.9.0
statsd==3.2.1
stestr==1.0.0
stevedore==1.20.0
tempest==17.1.0
tenacity==3.2.1
testrepository==0.0.18
stestr==2.0.0
testscenarios==0.4
testtools==2.2.0
traceback2==1.4.0

View File

@ -15,9 +15,8 @@ python-glanceclient>=2.8.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
os-client-config>=1.28.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
tempest>=17.1.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

22
tox.ini
View File

@ -9,7 +9,6 @@ usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals =
find
bash
rm
passenv = ZUUL_CACHE_DIR
REQUIREMENTS_PIP_LOCATION
@ -20,9 +19,7 @@ deps =
-r{toxinidir}/requirements.txt
commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
stestr run {posargs}
[testenv:pep8]
basepython = python3
@ -63,26 +60,27 @@ commands =
[testenv:functional]
basepython = python2.7
passenv = OS_NOVACLIENT_TEST_NETWORK
setenv =
OS_TEST_PATH = ./novaclient/tests/functional
commands =
bash tools/pretty_tox.sh '--concurrency=1 {posargs}'
stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs}
python novaclient/tests/functional/hooks/check_resources.py
[testenv:functional-py35]
basepython = python3.5
passenv = OS_NOVACLIENT_TEST_NETWORK
setenv =
OS_TEST_PATH = ./novaclient/tests/functional
commands =
bash tools/pretty_tox.sh '--concurrency=1 {posargs}'
stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs}
python novaclient/tests/functional/hooks/check_resources.py
[testenv:cover]
basepython = python3
setenv =
PYTHON=coverage run --source novaclient --parallel-mode
commands =
python setup.py testr --coverage --testr-args='{posargs}'
coverage report
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[flake8]
# Following checks should be enabled in the future.