Merge "Switch to stestr"

This commit is contained in:
Zuul 2018-05-07 13:24:55 +00:00 committed by Gerrit Code Review
commit c4db7a9c6c
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 fixtures>=0.3.12
mock>=1.0 mock>=1.0
python-subunit python-subunit
testrepository>=0.0.13 stestr>=1.0.0 # Apache-2.0
testscenarios testscenarios
testtools>=0.9.27 testtools>=0.9.27

17
tox.ini
View File

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