Browse Source

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: If3383707c9baf69e03bcccc50970da748a834141
changes/08/570008/11
Slawek Kaplonski 3 years ago
parent
commit
ec537c49e9
  1. 2
      .gitignore
  2. 8
      .testr.conf
  3. 1
      lower-constraints.txt
  4. 2
      test-requirements.txt
  5. 8
      tools/ostestr_compat_shim.sh
  6. 21
      tox.ini

2
.gitignore

@ -27,8 +27,8 @@ setuptools*.egg/
!/.mailmap
!/.pylintrc
!/.stestr.conf
!/.testr.conf
!/.zuul.yaml
.stestr/
# Files created by releasenotes build
releasenotes/build

8
.testr.conf

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

1
lower-constraints.txt

@ -61,7 +61,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

2
test-requirements.txt

@ -14,7 +14,7 @@ testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
WebTest>=2.0.27 # MIT
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
ddt>=1.0.1 # MIT
pylint==1.4.5 # GPLv2

8
tools/ostestr_compat_shim.sh

@ -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

21
tox.ini

@ -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
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
usedevelop = True
@ -15,8 +18,7 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands =
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
commands = stestr run {posargs}
# there is also secret magic in ostestr which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
@ -61,7 +63,7 @@ deps =
{[testenv:functional]deps}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
stestr run {posargs}
[testenv:dsvm-functional-python35]
basepython = python3.5
@ -70,7 +72,7 @@ deps =
{[testenv:dsvm-functional]deps}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
stestr run {posargs}
[testenv:dsvm-fullstack]
setenv = {[testenv]setenv}
@ -84,7 +86,7 @@ deps =
commands =
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
{toxinidir}/tools/ostestr_compat_shim.sh --concurrency 4 {posargs}
stestr run --concurrency 4 {posargs}
[testenv:dsvm-fullstack-python35]
basepython = python3.5
@ -94,7 +96,6 @@ deps =
commands =
{[testenv:dsvm-fullstack]commands}
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -121,9 +122,15 @@ whitelist_externals =
[testenv:cover]
basepython = python2.7
setenv =
{[testenv]setenv}
PYTHON=coverage run --source neutron --parallel-mode
commands =
python setup.py testr --coverage --testr-args='{posargs}'
stestr run --no-subunit-trace {posargs}
coverage combine
coverage report --fail-under=82 --skip-covered
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
commands = {posargs}

Loading…
Cancel
Save