Browse Source

Switch to using stestr

stestr is maintained project to which all Openstack projects
should migrate.

[1] https://etherpad.openstack.org/p/YVR-python-pti
[2] https://governance.openstack.org/tc/reference/pti/python.html

Change-Id: I3a4a8e6a7c856446686252d80046532e08d3936b
changes/23/573123/2
Nguyen Hai 3 years ago
parent
commit
5915585cd2
6 changed files with 15 additions and 27 deletions
  1. +3
    -0
      .stestr.conf
  2. +0
    -4
      .testr.conf
  3. +0
    -2
      lower-constraints.txt
  4. +1
    -2
      test-requirements.txt
  5. +0
    -8
      tools/ostestr_compat_shim.sh
  6. +11
    -11
      tox.ini

+ 3
- 0
.stestr.conf View File

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

+ 0
- 4
.testr.conf 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

+ 0
- 2
lower-constraints.txt 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


+ 1
- 2
test-requirements.txt 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

+ 0
- 8
tools/ostestr_compat_shim.sh 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

+ 11
- 11
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}


Loading…
Cancel
Save