Switch to using stestr

When the TC merged I2637dd714cbb6d38ef8b8dc1083e359207118284 we're
supposed to invoke stestr rather than testr so lets do that

Change-Id: I1b401c583d5e7677fc719bfc4eb2f2bba7b98cfa
This commit is contained in:
wangqi 2018-05-22 03:26:21 +00:00
parent 1ef5e5d169
commit 7edb3783c7
6 changed files with 16 additions and 12 deletions

1
.gitignore vendored
View File

@ -14,6 +14,7 @@ python_glanceclient.egg-info
ChangeLog ChangeLog
run_tests.err.log run_tests.err.log
.testrepository .testrepository
.stestr/
.tox .tox
doc/source/api doc/source/api
doc/build doc/build

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./glanceclient/tests/unit
top_path=./

View File

@ -1,4 +0,0 @@
[DEFAULT]
test_command=${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./glanceclient/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -69,10 +69,9 @@ six==1.10.0
snowballstemmer==1.2.1 snowballstemmer==1.2.1
Sphinx==1.6.2 Sphinx==1.6.2
sphinxcontrib-websupport==1.0.1 sphinxcontrib-websupport==1.0.1
stestr==1.0.0 stestr==2.0.0
stevedore==1.20.0 stevedore==1.20.0
tempest==17.1.0 tempest==17.1.0
testrepository==0.0.18
testscenarios==0.4 testscenarios==0.4
testtools==2.2.0 testtools==2.2.0
traceback2==1.4.0 traceback2==1.4.0

View File

@ -6,7 +6,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD mock>=2.0.0 # BSD
os-client-config>=1.28.0 # Apache-2.0 os-client-config>=1.28.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD

15
tox.ini
View File

@ -15,7 +15,7 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --testr-args='{posargs}' commands = stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]
commands = flake8 commands = flake8
@ -36,7 +36,7 @@ whitelist_externals =
bash bash
commands = commands =
bash tools/fix_ca_bundle.sh bash tools/fix_ca_bundle.sh
python setup.py testr --testr-args='{posargs}' stestr run --slowest {posargs}
[testenv:functional-v1] [testenv:functional-v1]
# TODO(rosmaita): remove this testenv at the beginning # TODO(rosmaita): remove this testenv at the beginning
@ -48,11 +48,16 @@ whitelist_externals =
bash bash
commands = commands =
bash tools/fix_ca_bundle.sh bash tools/fix_ca_bundle.sh
python setup.py testr --testr-args='{posargs}' stestr run --slowest {posargs}
[testenv:cover] [testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}' setenv =
coverage report PYTHON=coverage run --source glanceclient --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs] [testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt