Add .stestr.conf configuration

os-testr has moved over to use stestr instead of testr. While this
is usually compaible with existing settings, there is a warning
that is emitted when .stestr.conf is not present. It is usually
able to fall back to parsing the .testr.conf file, but to be more
correct and to prevent future problems we should update the config.

Change-Id: I203b3bde40029e4ffc48271becfa1f7a8ce4b1f7
This commit is contained in:
Sean McGinnis 2017-09-19 16:51:32 -05:00
parent d56c8a72b3
commit 606525327e
5 changed files with 19 additions and 11 deletions

2
.gitignore vendored
View File

@ -1,4 +1,5 @@
*.py[cod] *.py[cod]
/.*
# C extensions # C extensions
*.so *.so
@ -28,6 +29,7 @@ pip-log.txt
nosetests.xml nosetests.xml
.testrepository .testrepository
.venv .venv
cover
# Translations # Translations
*.mo *.mo

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./brick_cinderclient_ext/tests/unit}
top_dir=./

View File

@ -1,9 +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 ./ ${OS_TEST_PATH:-./brick_cinderclient_ext/tests/unit} \
$LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -15,3 +15,4 @@ reno>=2.5.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT testtools>=1.4.0 # MIT
os-testr>=1.0.0 # Apache-2.0

15
tox.ini
View File

@ -7,13 +7,17 @@ skipsdist = True
usedevelop = 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} install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
OS_TEST_PATH=./brick_cinderclient_ext/tests/unit
passenv = *_proxy *_PROXY passenv = *_proxy *_PROXY
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = commands =
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
python setup.py testr --testr-args='{posargs}' ostestr {posargs}
whitelist_externals = find whitelist_externals = find
[testenv:pep8] [testenv:pep8]
@ -32,7 +36,14 @@ setenv =
passenv = OS_* passenv = OS_*
[testenv:cover] [testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}' setenv =
{[testenv]setenv}
PYTHON=coverage run --source brick_cinderclient_ext --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs] [testenv:docs]
commands = python setup.py build_sphinx commands = python setup.py build_sphinx