From e7180a5876067e929e0606f552e91ee357a143d4 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 8 Jun 2012 19:59:26 -0400 Subject: [PATCH] Align tox.ini and fix coverage jobs in jenkins. The jenkins coverage jobs expect there to be a .coverage file, so deleting it is a bad idea. Also, coverage erase will do that for us. While we're in there, update tox.ini and setup.cfg to the latest. Change-Id: Icd0a8fc66a5146e0d94f62a9f65a4536981d2916 --- .coveragerc | 6 ++++++ setup.cfg | 8 +++----- tox.ini | 42 ++++++++++++++---------------------------- 3 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..5893dbe75f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +branch = True +omit = /usr*,setup.py,*egg*,.venv/*,.tox/*,test/* + +[report] +ignore-errors = True diff --git a/setup.cfg b/setup.cfg index 03e89ab4ef..409348eb71 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,8 +26,6 @@ output_file = locale/swift.pot exe=1 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 = swift +cover-html = true +cover-erase = true diff --git a/tox.ini b/tox.ini index a9e89c6b99..16648c2bb0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,43 +2,29 @@ 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 = nosetests test/unit [] +commands = nosetests test/unit {posargs} + +[tox:jenkins] +downloadcache = ~/cache/pip [testenv:pep8] -deps = pep8==0.6.1 +deps = pep8==1.1 commands = - pep8 --repeat --show-pep8 --show-source swift tools setup.py + pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,test . pep8 --repeat --show-pep8 --show-source --filename=swift* bin [testenv:cover] -commands = - coverage erase - nosetests test/unit --with-coverage --cover-html --cover-erase \ - --cover-package=swift - /bin/rm -f .coverage - -[testenv:hudson] -downloadcache = ~/cache/pip +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] -deps = file://{toxinidir}/.cache.bundle -commands = - nosetests test/unit --with-xcoverage --cover-erase --cover-package=swift - -[testenv:jenkinsvenv] -deps = file://{toxinidir}/.cache.bundle -commands = {posargs}