Switch to stestr

stestr is maintained, while testrepository is not. OpenStack is
migrating to stestr, go ahead and follow suit.

The --no-subunit-trace flag is added to keep the quiet test run
behavior. If we remove it, stestr will by default print the name of each
test as it starts it.

This uses environment inclusions which need tox 2.8.1 due to a bug fix.
So increase the tox minversion.

Change-Id: I08cd4bee86b56d9a68644b049497c34e34e5f226
This commit is contained in:
Monty Taylor 2018-01-23 09:11:27 -06:00
parent badb7e48ad
commit 0c71102f0e
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
5 changed files with 24 additions and 9 deletions

7
.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = nodepool
omit = nodepool/tests/*
[report]
ignore_errors = True

3
.stestr.conf Normal file
View File

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

View File

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

View File

@ -8,6 +8,6 @@ reno>=2.5.0 # Apache-2.0
fixtures>=0.3.12
mock>=1.0
python-subunit
testrepository>=0.0.13
stestr>=1.0.0 # Apache-2.0
testscenarios
testtools>=0.9.27

17
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
minversion = 1.6
minversion = 2.8.1
skipsdist = True
envlist = pep8,py35
@ -8,13 +8,16 @@ envlist = pep8,py35
setenv = STATSD_HOST=localhost
STATSD_PORT=8125
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}
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = NODEPOOL_ZK_HOST
commands =
python setup.py testr --slowest --testr-args='{posargs}'
commands = stestr run --no-subunit-trace {posargs}
stestr slowest
[testenv:pep8]
basepython = python3
@ -30,8 +33,14 @@ commands = bindep test
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source nodepool --parallel-mode
commands =
python setup.py testr --coverage
stestr run --no-subunit-trace {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
basepython = python3