install test-reqs when TESTONLY packages are installed

INSTALL_TESTONLY_PACKAGES in devstack only impacts .deb/.rpm files
even though most of our test requirements are actually specified
in python. This will do an explicit install of test-requirements.txt
if pip_install is called with args that look like a directory,
and test-requirements.txt exists in that directory.

Change-Id: Id21e282ddc945c819c9c8c4d724658e28bfde785
This commit is contained in:
Sean Dague 2014-07-15 12:07:42 +02:00
parent 5acf159c72
commit f3f4b0ac78

View File

@ -1386,6 +1386,19 @@ function pip_install {
$cmd_pip install --build=${pip_build_tmp} \
$pip_mirror_opt $@ \
&& $sudo_pip rm -rf ${pip_build_tmp}
if [[ "$INSTALL_TESTONLY_PACKAGES" == "True" ]]; then
local test_req="$@/test-requirements.txt"
if [[ -e "$test_req" ]]; then
$sudo_pip PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
http_proxy=$http_proxy \
https_proxy=$https_proxy \
no_proxy=$no_proxy \
$cmd_pip install --build=${pip_build_tmp} \
$pip_mirror_opt -r $test_req \
&& $sudo_pip rm -rf ${pip_build_tmp}
fi
fi
}
# this should be used if you want to install globally, all libraries should