diff --git a/.gitignore b/.gitignore index 6dc19a6eb0..cd78247219 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ *.swp vendor .ksl-venv +.venv +.tox +keystone.egg-info/ run_tests.log .coverage covhtml diff --git a/run_tests.sh b/run_tests.sh index 825d9501b1..c55a0cd9e5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -40,7 +40,7 @@ function process_option { esac } -venv=.ksl-venv +venv=.venv with_venv=tools/with_venv.sh always_venv=0 never_venv=0 @@ -89,7 +89,6 @@ function run_pep8 { srcfiles+=" keystone" # Just run PEP8 in current environment ${wrapper} pep8 --repeat --show-pep8 --show-source \ - --ignore=E202,E111 \ --exclude=vcsversion.py ${srcfiles} | tee pep8.txt } diff --git a/tools/install_venv.py b/tools/install_venv.py index c2489f29e1..11f682b63d 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -28,8 +28,8 @@ import sys ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -VENV = os.path.join(ROOT, '.ksl-venv') -PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires-test') +VENV = os.path.join(ROOT, '.venv') +PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires') PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) diff --git a/tools/pip-requires b/tools/pip-requires index c075d369ee..94ab44ba2c 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -1,3 +1,4 @@ +# keystonelight dependencies pam==0.1.4 WebOb==0.9.8 eventlet==0.9.12 @@ -9,4 +10,24 @@ sqlalchemy sqlalchemy-migrate py-bcrypt --e git+https://github.com/openstack/python-keystoneclient.git#egg=python-keystoneclient +# for python-novaclient +prettytable + +# Optional backend: Memcache +python-memcached # increases performance of token validation calls + +# Development +Sphinx>=1.1.2 # required to build documentation +coverage # computes code coverage percentages + +# Testing +nose # for test discovery and console feedback +nosexcover +unittest2 # backport of unittest lib in python 2.7 +webtest # test wsgi apps without starting an http server +pylint # static code analysis +pep8==0.6.1 # checks for PEP8 code style compliance +mox # mock object framework + +-e git+https://review.openstack.org/p/openstack/python-keystoneclient.git#egg=python-keystoneclient +-e git+https://review.openstack.org/p/openstack-dev/openstack-nose.git#egg=openstack.nose_plugin diff --git a/tools/with_venv.sh b/tools/with_venv.sh index 0ed2ef7268..c8d2940fc7 100755 --- a/tools/with_venv.sh +++ b/tools/with_venv.sh @@ -1,4 +1,4 @@ #!/bin/bash TOOLS=`dirname $0` -VENV=$TOOLS/../.ksl-venv +VENV=$TOOLS/../.venv source $VENV/bin/activate && $@ diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..e9a2fb389b --- /dev/null +++ b/tox.ini @@ -0,0 +1,26 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +deps = -r{toxinidir}/tools/pip-requires +commands = nosetests + +[testenv:pep8] +commands = pep8 --exclude=vcsversion.py,*.pyc --repeat --show-source bin keystone setup.py + +[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:jenkinspep8] +deps = file://{toxinidir}/.cache.bundle +commands = pep8 --exclude=vcsversion.py,*.pyc --repeat --show-source bin keystone setup.py + +