From 66108d0e483028101186e14caaa0dbcca785b797 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 3 Jun 2012 09:54:51 -0400 Subject: [PATCH] Fix coverage jobs. Also, clean up the tox.ini. Change-Id: I85e8f1b190e2c5f598ae76f2920dfbe7c4ed1500 --- .coveragerc | 6 ++++++ .gitignore | 6 ++++++ setup.cfg | 8 +++----- tools/test-requires | 2 +- tox.ini | 35 ++++++++++++----------------------- 5 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..c137405a --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +branch = True +omit = /usr*,setup.py,*egg*,.venv/*,.tox/*,glance/tests/* + +[report] +ignore-errors = True diff --git a/.gitignore b/.gitignore index df95d81a..baf2d4f3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,13 @@ .glance-venv .venv .tox +.coverage +cover/* +nosetests.xml +coverage.xml +glance.sqlite AUTHORS +ChangeLog build dist *.egg diff --git a/setup.cfg b/setup.cfg index 692f3175..9bf1871c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,8 +29,6 @@ output_file = glance/locale/glance.pot # openstack-nose https://github.com/jkoelker/openstack-nose 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 = glance +cover-html = true +cover-erase = true diff --git a/tools/test-requires b/tools/test-requires index 752d6810..5407984e 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -5,10 +5,10 @@ distribute>=0.6.24 Babel # Needed for testing +coverage mox nose nose-exclude -nosexcover openstack.nose_plugin pep8==1.1 sphinx>=1.1.2 diff --git a/tox.ini b/tox.ini index f41f9478..08432d80 100644 --- a/tox.ini +++ b/tox.ini @@ -3,35 +3,24 @@ 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 deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-requires -commands = {toxinidir}/run_tests.sh -N - -[testenv:pep8] -deps = pep8==1.1 -commands = pep8 --repeat --show-source bin glance setup.py - -[testenv:cover] -commands = nosetests --with-coverage --cover-html --cover-erase --cover-package=glance - -[testenv:venv] -commands = {posargs} +commands = nosetests {posargs} [tox:jenkins] downloadcache = ~/cache/pip -[testenv:jenkins26] -basepython = python2.6 -deps = file://{toxinidir}/.cache.bundle +[testenv:pep8] +deps = pep8==1.1 +commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc . -[testenv:jenkins27] -basepython = python2.7 -deps = file://{toxinidir}/.cache.bundle +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 -[testenv:jenkinscover] -deps = file://{toxinidir}/.cache.bundle -commands = nosetests --cover-erase --cover-package=glance --with-xcoverage - -[testenv:jenkinsvenv] -deps = file://{toxinidir}/.cache.bundle +[testenv:venv] commands = {posargs}