Merge "Switch to using stestr"

This commit is contained in:
Zuul 2018-06-18 15:12:45 +00:00 committed by Gerrit Code Review
commit 5e0335c007
6 changed files with 15 additions and 27 deletions

3
.stestr.conf Normal file
View File

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

View File

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

View File

@ -65,7 +65,6 @@ openstacksdk==0.12.0
os-api-ref==1.5.0
os-client-config==1.29.0
os-service-types==1.2.0
os-testr==1.0.0
osc-lib==1.10.0
oslo.cache==1.29.0
oslo.concurrency==3.26.0
@ -143,7 +142,6 @@ stevedore==1.20.0
tempest==17.1.0
Tempita==0.5.2
tenacity==4.9.0
testrepository==0.0.18
testresources==2.0.1
testscenarios==0.5.0
testtools==2.2.0

View File

@ -12,9 +12,8 @@ mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
python-tackerclient>=0.8.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
WebTest>=2.0.27 # MIT
python-barbicanclient>=4.5.2 # Apache-2.0

View File

@ -1,8 +0,0 @@
#!/bin/sh
# preserve old behavior of using an arg as a regex when '--' is not present
case $@ in
(*--*) ostestr $@;;
('') ostestr;;
(*) ostestr --regex "$@"
esac

22
tox.ini
View File

@ -6,6 +6,9 @@ skipsdist = True
[testenv]
basepython = {env:TACKER_TOX_PYTHON:python2}
setenv = VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
passenv = UPPER_CONSTRAINTS_FILE
usedevelop = True
whitelist_externals = rm
@ -14,8 +17,7 @@ install_command =
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
rm -f .testrepository/times.dbm
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
stestr run --slowest {posargs}
[testenv:functional]
setenv = OS_TEST_PATH=./tacker/tests/functional
@ -29,7 +31,7 @@ setenv = {[testenv]setenv}
deps =
{[testenv:functional]deps}
commands =
{toxinidir}/tools/ostestr_compat_shim.sh --concurrency 2 {posargs}
stestr run --slowest --concurrency 2 {posargs}
[testenv:debug]
commands = oslo_debug_helper {posargs}
@ -62,8 +64,6 @@ commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
@ -75,14 +75,14 @@ deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv =
PYTHON=coverage run --source tacker --parallel-mode
commands =
coverage erase
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
[testenv:venv]
commands = {posargs}