Finalize tox config.

Shrink tox.ini to the new short version.
Fix the test cases to be able to be run in nosetets plus the
openstack.nose_plugin, which finally removes the need for
nova/testing/runner.py
Also, now we'll just output directly to stdout, which will
make nose collect the trace logging directly and either output
it at the end of the run, or inject it into the xunit output
appropriately.

Change-Id: I1456e18a11a840145492038108bdfe812c8230d1
This commit is contained in:
Monty Taylor
2012-06-03 13:03:21 -04:00
parent f6cdd60d3a
commit 9f42135f18
5 changed files with 33 additions and 25 deletions

6
.coveragerc Normal file
View File

@@ -0,0 +1,6 @@
[run]
branch = True
omit = /usr*,setup.py,*egg*,.venv/*,.tox/*,nova/tests/*
[report]
ignore-errors = True

7
.gitignore vendored
View File

@@ -2,6 +2,7 @@
*.DS_Store
local_settings.py
ChangeLog
MANIFEST
CA/
keeper
instances
@@ -15,9 +16,13 @@ nova.egg-info
*.sqlite
*.log
*.mo
nosetests.xml
coverage.xml
tools/conf/nova.conf*
cover/*
nova/tests/cover/*
nova/vcsversion.py
.autogenerated
dist/*
.coverage
covhtml
nova/tests/coverage.xml

View File

@@ -39,8 +39,16 @@ import shutil
from nova.db.sqlalchemy.session import get_engine
from nova import flags
from nova import log as logging
import eventlet
eventlet.monkey_patch()
FLAGS = flags.FLAGS
FLAGS.use_stderr = False
logging.setup()
_DB = None

View File

@@ -25,8 +25,7 @@ output_file = nova/locale/nova.pot
[nosetests]
verbosity=2
detailed-errors=1
with-openstack=1
openstack-red=0.05
openstack-yellow=0.025
openstack-show-elapsed=1
openstack-color=1
cover-package = nova
cover-html = true
cover-erase = true
where=nova/tests

28
tox.ini
View File

@@ -3,9 +3,15 @@ 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
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands = /bin/bash run_tests.sh -N -P
commands = nosetests {posargs}
[tox:jenkins]
sitepackages = True
@@ -13,26 +19,10 @@ downloadcache = ~/cache/pip
[testenv:pep8]
deps = pep8==1.1
commands = /bin/bash run_tests.sh -N --pep8
commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc .
[testenv:cover]
commands = /bin/bash run_tests.sh -N -P --cover-package=nova --cover-erase --with-xcoverage
setenv = NOSE_WITH_COVERAGE=1
[testenv:venv]
commands = {posargs}
[testenv:jenkins26]
basepython = python2.6
deps = file://{toxinidir}/.cache.bundle
[testenv:jenkins27]
basepython = python2.7
deps = file://{toxinidir}/.cache.bundle
[testenv:jenkinscover]
commands = /bin/bash run_tests.sh -N -P --cover-package=nova --cover-erase --with-xcoverage
[testenv:jenkinsvenv]
deps = file://{toxinidir}/.cache.bundle
commands = {posargs}