Switch to use stestr for unit tests

The patch:
 * replaces .testr.conf by .stestr.conf
 * removes os-testr requirement
 * adds stestr requirement
 * edits tox.ini file so that only stestr is used
 * removes .testrepository from .gitignore

Change-Id: I14dae1cc58e3b5e2b3157df0803c3a15e9b55102
This commit is contained in:
Martin Kopec 2017-12-04 14:57:53 +00:00
parent c51c0d8655
commit ea03aeedf2
5 changed files with 9 additions and 12 deletions

1
.gitignore vendored
View File

@ -27,7 +27,6 @@ cover/
!.coveragerc
.tox
nosetests.xml
.testrepository
.venv
.stestr

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./config_tempest/tests
top_dir=./

View File

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

View File

@ -5,6 +5,6 @@
pbr>=1.8 # Apache-2.0
tempest>=14.0.0 # Apache-2.0
requests>=2.10.0,!=2.12.2 # Apache-2.0
os-testr>=0.8.0 # Apache-2.0
stestr>=1.1.0 # Apache-2.0
os-client-config>=1.26.0 # Apache-2.0
oslo_config>=3.23.0 # Apache-2.0

View File

@ -7,7 +7,6 @@ skipsdist = True
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
OS_TEST_PATH=./config_tempest/tests
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
whitelist_externals = *
@ -16,7 +15,7 @@ deps =
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
ostestr {posargs}
stestr --test-path ./config_tempest/tests run {posargs}
[testenv:pep8]
commands = flake8 {posargs}
@ -25,7 +24,10 @@ commands = flake8 {posargs}
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr --test-path ./config_tempest/tests run {posargs}
[testenv:docs]
commands = python setup.py build_sphinx