diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..1e552e522 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = nodepool +omit = nodepool/tests/* + +[report] +ignore_errors = True diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..cef09df62 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=nodepool/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 817745d4c..000000000 --- a/.testr.conf +++ /dev/null @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 5a357a2b3..81b770854 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 6638ca5a2..1c422cfc2 100644 --- a/tox.ini +++ b/tox.ini @@ -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