summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2012-10-30 16:30:02 -0700
committerClark Boylan <clark.boylan@gmail.com>2012-12-14 14:22:20 -0800
commit4abc8cc64fe9ec2467b8bce56a846aae6fd18ed4 (patch)
tree4f8a491b3289ca54406fce0bc501338dc745cb8c /tox.ini
parent8652d71ade5e778da7c5934cc313f9c85443a0ce (diff)
downloadnova-4abc8cc64fe9ec2467b8bce56a846aae6fd18ed4.tar.gz
Use testr to run nova unittests.
Convert nova from using nosetests to testr for its test runner. Some tests had to be modified to get them to run properly under testr. run_tests.sh has been updated to run testr instead of nosetests. Coverage is collected by running subunit.run under coverage.py when the coverage environment is selected. Note that you will need to rebuild your virtualenvs as nose is being removed from the dependency lists and is being replaced by testr. Tests will run in different processes once this test is merged so you cannot use test classes to pass information between tests. Each test should be a proper independent unit. Additionally the -x and -d flags to run_tests.sh have been removed as there are currently no decent approximations for those functions. Change-Id: I019ca098972ca749b195f59968cf21edd5ba9109
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini19
1 files changed, 11 insertions, 8 deletions
diff --git a/tox.ini b/tox.ini
index 586013081d..4fa567518b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,19 +3,16 @@ envlist = py26,py27,pep8
[testenv]
setenv = VIRTUAL_ENV={envdir}
- NOSE_WITH_OPENSTACK=1
- NOSE_OPENSTACK_COLOR=1
- NOSE_OPENSTACK_RED=0.05
- NOSE_OPENSTACK_YELLOW=0.025
- NOSE_OPENSTACK_SHOW_ELAPSED=1
- NOSE_OPENSTACK_STDOUT=1
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
+ OS_STDOUT_NOCAPTURE=False
+ OS_STDERR_NOCAPTURE=False
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
-commands = nosetests {posargs}
+commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
+ bash -c 'testr run --parallel {posargs} ; RET=$? ; echo "Slowest Tests" ; testr slowest && exit $RET'
[tox:jenkins]
sitepackages = True
@@ -40,7 +37,13 @@ deps = pyflakes
commands = python tools/flakes.py nova
[testenv:cover]
-setenv = NOSE_WITH_COVERAGE=1
+# Need to omit DynamicallyCompiledCheetahTemplate.py from coverage because
+# it ceases to exist post test run. Also do not run test_coverage_ext tests
+# while gathering coverage as those tests conflict with coverage.
+setenv = OMIT=--omit=DynamicallyCompiledCheetahTemplate.py
+ PYTHON=coverage run --source nova --parallel-mode
+commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
+ bash -c 'testr run --parallel \^\(\?\!\.\*test_coverage_ext\)\.\*\$ ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET'
[testenv:venv]
commands = {posargs}