From eea25b41499baa62ce73967865c20d2856503bd2 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 6 Feb 2012 13:15:38 +0000 Subject: [PATCH] Prep tox config for jenkins builds. Change-Id: Id81588d3a2aabc0931d5bf12f078d8f770305e69 --- .gitignore | 1 + setup.cfg | 13 +++++++++++++ tools/pip-requires | 13 ++++++++----- tox.ini | 32 +++++++++++++++++++++++++++++--- 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 52b5f3df..cbb155a2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.log .glance-venv .venv +.tox build dist glance.egg-info diff --git a/setup.cfg b/setup.cfg index d53addcb..6585cc74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,3 +7,16 @@ source-dir = doc/source tag_build = tag_date = 0 tag_svn_revision = 0 + +[nosetests] +# NOTE(jkoelker) To run the test suite under nose install the following +# coverage http://pypi.python.org/pypi/coverage +# tissue http://pypi.python.org/pypi/tissue (pep8 checker) +# 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 diff --git a/tools/pip-requires b/tools/pip-requires index 66c8a3c1..882b3180 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -4,17 +4,12 @@ greenlet>=0.3.1 SQLAlchemy>=0.6.3,<0.7 -pep8==0.6.1 -pylint==0.19 anyjson eventlet>=0.9.12 PasteDeploy routes webob==1.0.8 wsgiref -nose -nose-exclude -nosexcover sphinx argparse mox @@ -43,3 +38,11 @@ lxml Paste passlib + +# Needed for testing +nose +nose-exclude +nosexcover +openstack.nose_plugin +pep8==0.6.1 +pylint==0.19 diff --git a/tox.ini b/tox.ini index 69689cbe..5b9b99bf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,36 @@ [tox] -envlist = py26,py27 +envlist = py26,py27,pep8 [testenv] +setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/tools/pip-requires -commands = /bin/bash run_tests.sh -N +commands = nosetests [testenv:pep8] -commands = pep8 --repeat glance +deps = pep8 +commands = pep8 --repeat --show-source bin glance setup.py +[testenv:pylint] +deps = pylint +commands = pylint --rcfile=pylintrc --output-format=parseable glance + +[testenv:cover] +commands = nosetests --with-coverage --cover-html --cover-erase --cover-package=glance + +[testenv:sdist] +commands = python setup.py sdist {posargs} + +[testenv:hudson] +downloadcache = ~/cache/pip + +[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 --cover-erase --cover-package=glance --with-xcoverage