Use constrainted environments for testing

In the OpenStack CI, constrainted environment is used for testing
to avoid unexpected gate breakage. This commit introduces it to
networking-nec testing.

Change-Id: If1776088a6e21fc4783a267d60881ec755e3391f
This commit is contained in:
Akihiro Motoki 2016-04-08 14:33:16 +09:00
parent db60ac7c93
commit cc4efc5ec3
2 changed files with 16 additions and 5 deletions

View File

@ -20,6 +20,14 @@ BRANCH_NAME=stable/mitaka
set -e
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"
@ -33,12 +41,12 @@ elif [ -x "$ZUUL_CLONER" ]; then
git://git.openstack.org \
openstack/neutron
cd openstack/neutron
pip install -e .
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
pip install -U -egit+https://git.openstack.org/openstack/neutron.git@$BRANCH_NAME#egg=neutron
$install_cmd -U -egit+https://git.openstack.org/openstack/neutron.git@$BRANCH_NAME#egg=neutron
fi
pip install -U $*
$install_cmd -U $*
exit $?

View File

@ -5,11 +5,14 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {opts} {packages}
install_command =
# networking-nec is still targetted to Mitaka development,
# so we need to use upper-constraints.txt from stable/mitaka branch.
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka} {opts} {packages}
# Note the hash seed is set to 0 until neutron can be tested with a
# random hash seed successfully.
setenv =
VIRTUAL_ENV={envdir}
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands =