Install "ironic" in the unittest environment

This patch is adding a helper script called "pip_install" to install
ironic in the unittests environment. This is needed because drivers will
import modules directly from Ironic (e.g the base driver interfaces,
exceptions)

Change-Id: I42ccbfde8f3381b9d77f85b3f676c0b455c62851
This commit is contained in:
Lucas Alvares Gomes 2016-01-28 14:30:23 +00:00
parent a27e38e50c
commit de7c10fdae
3 changed files with 22 additions and 3 deletions

1
.gitignore vendored
View File

@ -28,6 +28,7 @@ pip-log.txt
nosetests.xml
.testrepository
.venv
.test-tars
# Translations
*.mo

20
pip_install Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
set -ex
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
mkdir -p .test-tars
if $(python -c "import ironic" 2> /dev/null); then
echo "Ironic already installed."
elif [ -x $ZUUL_CLONER ]; then
$ZUUL_CLONER --cache-dir /opt/git --workspace /tmp git://git.openstack.org openstack/ironic
pip install /tmp/openstack/ironic
else
( cd .test-tars && wget -N http://tarballs.openstack.org/ironic/ironic-master.tar.gz )
pip install .test-tars/ironic-master.tar.gz
fi
pip install -U $*
exit $?

View File

@ -5,9 +5,7 @@ envlist = py34,py27,pep8
[testenv]
usedevelop = True
install_command =
constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
pip install -U {opts} {packages}
install_command = {toxinidir}/pip_install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
LANGUAGE=en_US