Stop doing any magic cloning of neutron during CI

Change-Id: Iee43c68b4cc954b9780de02625de7e053ebd27b3
This commit is contained in:
Doug Wiegley 2015-06-04 17:09:23 -06:00
parent 58c1b4700a
commit c61f920f2a
2 changed files with 43 additions and 20 deletions

41
tools/tox_install.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
# This wrapper for tox's package installer will use the existing package
# if it exists, else use zuul-cloner if that program exists, else grab it
# from neutron master via a hard-coded URL. That last case should only
# happen with devs running unit tests locally.
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
set -e
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install.txt
cwd=$(/bin/pwd)
cd /tmp
$ZUUL_CLONER --cache-dir \
/opt/git \
git://git.openstack.org \
openstack/neutron
cd openstack/neutron
pip install -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
pip install -U -egit+https://git.openstack.org/openstack/neutron#egg=neutron
fi
pip install -U $*
exit $?

22
tox.ini
View File

@ -6,9 +6,8 @@ skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install -U {opts} {packages}
deps = -egit+https://git.openstack.org/openstack/neutron#egg=neutron
-r{toxinidir}/requirements.txt
install_command = {toxinidir}/tools/tox_install.sh {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands =
@ -16,19 +15,6 @@ commands =
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:functional]
setenv = OS_TEST_PATH=./neutron-lbaas/tests/functional
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:dsvm-functional]
setenv = OS_TEST_PATH=./neutron-lbaas/tests/functional
OS_SUDO_TESTING=1
OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
OS_FAIL_ON_MISSING_DEPS=1
sitepackages=True
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[tox:jenkins]
sitepackages = True
@ -77,8 +63,6 @@ import_exceptions = neutron.i18n
local-check-factory = neutron.hacking.checks.factory
[testenv:apiv1]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
sitepackages = True
setenv =
OS_TEST_PATH={toxinidir}/neutron_lbaas/tests/tempest/v1/api
@ -86,8 +70,6 @@ setenv =
TEMPEST_CONFIG_DIR={toxinidir}/neutron_lbaas/tests/tempest/etc
[testenv:apiv2]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
sitepackages = True
setenv =
OS_TEST_PATH={toxinidir}/neutron_lbaas/tests/tempest/v2/api