Install horizon in runtest.sh

This patch addresses the case where a user executes runtest.sh to
run the units test and fails because horizon is not installed.

With inspiration from the Sahara project copied the wrapper code
to install horizon in the install_venv.py.

Change-Id: I2ee4a89409f8976d1df6dcc144bb975e5fbc95e9
Closes-Bug: #1570443
This commit is contained in:
Duk Loi 2016-04-20 10:19:24 -04:00
parent f2fd0b799f
commit bb5e023998

View File

@ -32,6 +32,7 @@ VENV = os.path.join(ROOT, '.venv')
WITH_VENV = os.path.join(ROOT, 'tools', 'with_venv.sh')
PIP_REQUIRES = os.path.join(ROOT, 'requirements.txt')
TEST_REQUIRES = os.path.join(ROOT, 'test-requirements.txt')
PIP_INSTALL_WRAPPER = os.path.join(ROOT, 'tools', 'pip_install.sh')
def die(message, *args):
@ -113,11 +114,16 @@ def pip_install(*args):
run_command(args, redirect_output=False)
def pip_install_with_horizon(*args):
args = [WITH_VENV, PIP_INSTALL_WRAPPER, 'unconstrained'] + list(args)
run_command(args, redirect_output=False)
def install_dependencies(venv=VENV):
print "Installing dependencies..."
print "(This may take several minutes, don't panic)"
pip_install('-r', TEST_REQUIRES)
pip_install('-r', PIP_REQUIRES)
pip_install_with_horizon('-r', TEST_REQUIRES)
pip_install_with_horizon('-r', PIP_REQUIRES)
# Tell the virtual env how to "import dashboard"
py = 'python%d.%d' % (sys.version_info[0], sys.version_info[1])