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: I9fd237292f7da50e60da398b1649001bf1829c66
This commit is contained in:
Slawek Kaplonski 2018-06-07 13:18:23 +02:00
parent 26bfa08b23
commit 93a8b15840
6 changed files with 18 additions and 27 deletions

1
.gitignore vendored
View File

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

View File

@ -1,10 +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:-60} \
OS_LOG_CAPTURE=1 \
${PYTHON:-python} -m subunit.run discover -t ./ \
${OS_TEST_PATH:-./neutron_dynamic_routing/tests/unit} \
$LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

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

View File

@ -11,7 +11,7 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
oslo.concurrency>=3.25.0 # Apache-2.0 oslo.concurrency>=3.25.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
testresources>=2.0.0 # Apache-2.0/BSD testresources>=2.0.0 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD

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

23
tox.ini
View File

@ -5,6 +5,9 @@ skipsdist = True
[testenv] [testenv]
setenv = VIRTUAL_ENV={envdir} 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 PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True usedevelop = True
install_command =pip install {opts} {packages} install_command =pip install {opts} {packages}
@ -17,14 +20,15 @@ whitelist_externals =
commands = commands =
find . -type f -name "*.py[c|o]" -delete find . -type f -name "*.py[c|o]" -delete
find . -type d -name "__pycache__" -delete find . -type d -name "__pycache__" -delete
ostestr '{posargs}' stestr run {posargs}
# there is also secret magic in ostestr which lets you run in a fail only # 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. # mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:functional] [testenv:functional]
setenv = OS_TEST_PATH=./neutron_dynamic_routing/tests/functional setenv = OS_TEST_PATH=./neutron_dynamic_routing/tests/functional
commands = commands =
ostestr --slowest '{posargs}' stestr run {posargs}
stestr slowest
[testenv:api] [testenv:api]
sitepackages=True sitepackages=True
@ -33,7 +37,8 @@ setenv =
OS_TESTR_CONCURRENCY=1 OS_TESTR_CONCURRENCY=1
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc} TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
commands = commands =
ostestr --slowest '{posargs}' stestr run {posargs}
stestr slowest
[testenv:dsvm-functional] [testenv:dsvm-functional]
setenv = setenv =
@ -47,7 +52,7 @@ whitelist_externals =
cp cp
sudo sudo
commands = commands =
ostestr '{posargs}' stestr run {posargs}
[testenv:releasenotes] [testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -59,8 +64,14 @@ commands =
{[testenv:genconfig]commands} {[testenv:genconfig]commands}
[testenv:cover] [testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source neutron_dynamic_routing --parallel-mode
commands = commands =
python setup.py test --coverage --coverage-package-name=neutron_dynamic_routing --testr-args='{posargs}' stestr run --no-subunit-trace {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}