From 52c72cc2f264cac9a08307586bd5f0f179c4b183 Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Mar 2021 19:12:06 +0100 Subject: [PATCH] Activate virtual environment Enable virtualenv after installation. Without it, python packages from system location will be used. So if bindep is not installed in system packages the failure will be as ~/tripleo-validations/scripts/..//scripts/bindep-install: line 37: bindep: command not found This patch activates virtualenv after creation on previous step in accordance rather than before pytest. Change-Id: I3725bf64bead30b02f10eb9a68d220c4e422b531 --- scripts/run-local-test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/run-local-test b/scripts/run-local-test index debd1a0f9..16b31ca0e 100755 --- a/scripts/run-local-test +++ b/scripts/run-local-test @@ -47,6 +47,9 @@ sudo touch /etc/ci/mirror_info.sh # Create a virtual env "${PYTHON_EXEC}" -m virtualenv --system-site-packages "${HOME}/test-python" +# Activate a virtual env +PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" + # Run bindep "${HOME}/test-python/bin/pip" install "pip>=19.1.1" setuptools bindep --upgrade "${PROJECT_DIR}/scripts/bindep-install" @@ -61,7 +64,6 @@ fi -r "${PROJECT_DIR}/molecule-requirements.txt" # Run local test -PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" source "${PROJECT_DIR}/ansible-test-env.rc" export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \