Skip to content

Commit

Permalink
Download caching, dependency cleanup, run_tests improvements.
Browse files Browse the repository at this point in the history
Fixed bug 888813 -- removed duplicate installations of glance as
a dependency in buildout. Set a required version for pycrypto
as a dependency since older versions will fail, but 2.4 can't be
installed by buildout. Turned on download caching for pip and
buildout in run_tests.sh. Turned on mirroring for pip, just
in case.

Made the output from run_tests.sh commands a little more helpful.
Made sure that commands like --pep8 and --pylint don't stop
partway through due to bad exit codes.

Change-Id: Ie7f645707741b86908029ea1821fe2129004c0b3
  • Loading branch information
gabrielhurley committed Nov 11, 2011
1 parent cb17179 commit ae7b40f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 47 deletions.
50 changes: 8 additions & 42 deletions horizon/buildout.cfg
@@ -1,7 +1,7 @@
[buildout]
download-cache = /tmp/.buildout_cache/
parts =
django
launchpad
openstack-compute
openstackx
python-novaclient
Expand All @@ -14,12 +14,14 @@ versions = versions
[versions]
django = 1.3
# the following are for glance-dependencies
eventlet = 0.9.12
greenlet = 0.3.1
eventlet = 0.9.12
pep8 = 0.5.0
sqlalchemy = 0.6.3
sqlalchemy-migrate = 0.6
webob = 1.0.8
glance = 2011.3
pycrypto = 2.3


[dependencies]
Expand All @@ -36,27 +38,7 @@ eggs =
quantum
django-nose-selenium
CherryPy
interpreter = python


# glance doesn't have a client, and installing
# from bzr doesn't install deps
[glance-dependencies]
recipe = zc.recipe.egg
eggs =
PasteDeploy
anyjson
argparse
eventlet
greenlet
kombu
paste
pep8
routes
sqlalchemy
sqlalchemy-migrate
webob
xattr
pycrypto
interpreter = python


Expand All @@ -80,7 +62,6 @@ test = horizon
eggs =
${dependencies:eggs}
${horizon:eggs}
${glance-dependencies:eggs}
extra-paths =
${buildout:directory}/parts/openstack-compute
${buildout:directory}/parts/openstackx
Expand All @@ -95,39 +76,24 @@ recipe = zerokspot.recipe.git
repository = git://github.com/jacobian/openstack.compute.git
as_egg = True


[openstackx]
recipe = zerokspot.recipe.git
repository = git://github.com/cloudbuilders/openstackx.git
as_egg = True


[python-novaclient]
recipe = zerokspot.recipe.git
repository = git://github.com/rackspace/python-novaclient.git
as_egg = True


[python-keystoneclient]
recipe = zerokspot.recipe.git
repository = git://github.com/4P/python-keystoneclient.git
as_egg = True

## Dependencies fetched from launchpad
# launchpad dependencies will appear as subfolders of
# ${buildout:directory}/launchpad/
# multiple urls can be specified, format is
# branch_url subfolder_name
# don't forget to add directory to extra_paths in [django]
[launchpad]
recipe = bazaarrecipe
urls =
https://launchpad.net/~hudson-openstack/glance/trunk/ glance


## Dependencies fetch from other bzr locations
#[bzrdeps]
#recipe = bazaarrecipe
#urls =
# https://launchpad.net/~hudson-openstack/glance/trunk/ glance


[seleniumrc]
recipe=collective.recipe.seleniumrc
3 changes: 2 additions & 1 deletion openstack-dashboard/tools/pip-requires
Expand Up @@ -6,12 +6,13 @@ django-nose==0.1.2
django-nose-selenium
django-registration==0.7
eventlet
glance
glance==2011.3
kombu
mox
nose==1.0.0
paste
PasteDeploy
pycrypto==2.3
python-cloudfiles
python-dateutil
quantum
Expand Down
26 changes: 22 additions & 4 deletions run_tests.sh
Expand Up @@ -58,18 +58,21 @@ function process_option {
function run_server {
echo "Starting Django development server..."
${django_wrapper} python openstack-dashboard/dashboard/manage.py runserver
echo "Server stopped."
}

function run_pylint {
echo "Running pylint ..."
PYLINT_INCLUDE="openstack-dashboard/dashboard horizon/horizon"
${django_wrapper} pylint --rcfile=.pylintrc -f parseable $PYLINT_INCLUDE > pylint.txt
${django_wrapper} pylint --rcfile=.pylintrc -f parseable $PYLINT_INCLUDE > pylint.txt || true
CODE=$?
grep Global -A2 pylint.txt
if [ $CODE -lt 32 ]
then
echo "Completed successfully."
exit 0
else
echo "Completed with problems."
exit $CODE
fi
}
Expand All @@ -81,9 +84,15 @@ function run_pep8 {
PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat"
PEP8_INCLUDE="openstack-dashboard/dashboard horizon/horizon"
echo "${django_wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE > pep8.txt"
#${django_wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE > pep8.txt
#perl string strips out the [ and ] characters
${django_wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE > pep8.txt
${django_wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE > pep8.txt || true
PEP8_COUNT=`wc -l pep8.txt | awk '{ print $1 }'`
if [ $PEP8_COUNT -ge 1 ]; then
echo "PEP8 violations found ($PEP8_COUNT):"
cat pep8.txt
echo "Please fix all PEP8 violations before committing."
else
echo "No violations found. Good job!"
fi
}

function run_sphinx {
Expand All @@ -92,6 +101,7 @@ function run_sphinx {
export DJANGO_SETTINGS_MODULE=dashboard.settings
echo "${django_wrapper} sphinx-build -b html docs/source docs/build/html"
${django_wrapper} sphinx-build -b html docs/source docs/build/html
echo "Build complete."
}

# DEFAULTS FOR RUN_TESTS.SH
Expand Down Expand Up @@ -156,15 +166,23 @@ function sanity_check {
}

function install_venv {
# Install openstack-dashboard with install_venv.py
export PIP_DOWNLOAD_CACHE=/tmp/.pip_download_cache
export PIP_USE_MIRRORS=true
cd openstack-dashboard
python tools/install_venv.py
cd ..
# Install horizon with buildout
if [ ! -d /tmp/.buildout_cache ]; then
mkdir -p /tmp/.buildout_cache
fi
cd horizon
python bootstrap.py
bin/buildout
cd ..
django_wrapper="${django_with_venv}"
dashboard_wrapper="${dashboard_with_venv}"
# Make sure it worked and record the environment version
sanity_check
echo $environment_version > .environment_version
}
Expand Down

0 comments on commit ae7b40f

Please sign in to comment.