Support tox-based unittests.

Change-Id: I6a0a616a979688595762e6b772d77a14f1968070
This commit is contained in:
Monty Taylor 2012-01-07 19:34:41 -08:00
parent eab6a9fa76
commit 51210081a8
5 changed files with 53 additions and 8 deletions

4
.gitignore vendored
View File

@ -10,7 +10,11 @@ build-stamp
nova.egg-info nova.egg-info
.nova-venv .nova-venv
.venv .venv
.tox
*.sqlite *.sqlite
*.log *.log
*.mo *.mo
tools/conf/nova.conf* tools/conf/nova.conf*
cover/*
dist/*
.coverage

View File

@ -32,6 +32,7 @@ import sys
ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
VENV = os.path.join(ROOT, '.venv') VENV = os.path.join(ROOT, '.venv')
PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires') PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires')
TEST_REQUIRES = os.path.join(ROOT, 'tools', 'test-requires')
PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
@ -188,6 +189,7 @@ def install_dependencies(venv=VENV):
pip_install('greenlet') pip_install('greenlet')
pip_install('-r', PIP_REQUIRES) pip_install('-r', PIP_REQUIRES)
pip_install('-r', TEST_REQUIRES)
# Tell the virtual env how to "import nova" # Tell the virtual env how to "import nova"
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages", pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",

View File

@ -1,6 +1,4 @@
SQLAlchemy>=0.7.3 SQLAlchemy>=0.7.3
pep8==0.6.1
pylint==0.19
Cheetah==2.4.4 Cheetah==2.4.4
amqplib==0.6.1 amqplib==0.6.1
anyjson==0.2.4 anyjson==0.2.4
@ -16,19 +14,13 @@ python-novaclient
routes==1.12.3 routes==1.12.3
WebOb==1.0.8 WebOb==1.0.8
wsgiref==0.1.2 wsgiref==0.1.2
mox==0.5.3
greenlet>=0.3.1 greenlet>=0.3.1
nose
PasteDeploy==1.5.0 PasteDeploy==1.5.0
paste paste
sqlalchemy-migrate>=0.7.2 sqlalchemy-migrate>=0.7.2
netaddr netaddr
sphinx
glance glance
xattr>=0.6.0
suds==0.4 suds==0.4
coverage
nosexcover
paramiko paramiko
feedparser feedparser
pycrypto pycrypto

10
tools/test-requires Normal file
View File

@ -0,0 +1,10 @@
# Packages needed for dev testing
distribute>=0.6.24
coverage
mox==0.5.3
nose
nosexcover
openstack.nose_plugin
pep8==0.6.1
sphinx>=1.1.2

37
tox.ini Normal file
View File

@ -0,0 +1,37 @@
[tox]
envlist = py26,py27,pep8
[testenv]
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands = /bin/bash run_tests.sh -N -P
[testenv:hudson]
downloadcache = ~/cache/pip
[testenv:pep8]
deps = pep8
commands = /bin/bash run_tests.sh -N --pep8
[testenv:coverage]
commands = /bin/bash run_tests.sh -N -P --coverage
[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 = /bin/bash run_tests.sh -N --coverage
[testenv:jenkinsvenv]
deps = file://{toxinidir}/.cache.bundle
commands = {posargs}