Switch to stestr

According to Openstack summit session [1] stestr is
maintained project to which all Openstack projects
should migrate.
Let's switch it then.

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

Change-Id: Ia4c71631e4c51ec814bcefc115d4f5690c11e37b
This commit is contained in:
Slawek Kaplonski 2018-06-07 14:39:50 +02:00
parent f74540e9c9
commit 83db537dc6
6 changed files with 16 additions and 20 deletions

1
.gitignore vendored
View File

@ -28,7 +28,6 @@ subunit.log
!/.gitreview
!/.mailmap
!/.pylintrc
!/.testr.conf
!/.stestr.conf
# Files created by releasenotes build

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:-./neutron_vpnaas/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -60,7 +60,6 @@ openstackdocstheme==1.18.1
openstacksdk==0.11.2
os-client-config==1.28.0
os-service-types==1.2.0
os-testr==1.0.0
os-xenapi==0.3.1
osc-lib==1.8.0
oslo.cache==1.26.0

View File

@ -20,4 +20,4 @@ WebOb>=1.7.1 # MIT
WebTest>=2.0.27 # MIT
oslotest>=3.2.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
stestr>=1.0.0 # 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

20
tox.ini
View File

@ -5,6 +5,9 @@ skipsdist = True
[testenv]
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}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
@ -12,8 +15,8 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/re
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands =
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
# there is also secret magic in ostestr which lets you run in a fail only
stestr run {posargs}
# there is also secret magic in stestr which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:functional]
@ -39,7 +42,7 @@ sitepackages=True
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
ostestr '{posargs}'
stestr run {posargs}
[testenv:dsvm-functional-sswan]
setenv =
@ -50,7 +53,7 @@ sitepackages=True
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
ostestr '{posargs}'
stestr run {posargs}
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -68,8 +71,15 @@ whitelist_externals = sh
commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source neutron_vpnaas --parallel-mode
commands =
python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}'
stestr run --no-subunit-trace {posargs}
coverage combine
coverage report --skip-covered
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
commands = {posargs}