Install dependencies on virtualenv creation only.
@@ -126,7 +126,10 @@ echo "Running tests for pack: ${PACK_NAME}"
# Create virtualenv
VIRTUALENV_DIR="${VIRTUALENVS_DIR}/${PACK_NAME}"
-if [ "${CREATE_VIRTUALENV}" = true ]; then
+if [ "${CREATE_VIRTUALENV}" = false ]; then
+ echo "Activating virtualenv in ${VIRTUALENV_DIR}..."
+ source ${VIRTUALENV_DIR}/bin/activate
+else
echo "Creating virtualenv in ${VIRTUALENV_DIR}..."
mkdir -p ${VIRTUALENVS_DIR}
virtualenv --system-site-packages ${VIRTUALENV_DIR}
@@ -136,19 +139,9 @@ if [ "${CREATE_VIRTUALENV}" = true ]; then
# Activate created virtualenv
source ${VIRTUALENV_DIR}/bin/activate
-fi
-# Note: If we are running outside of st2, we need to add all the st2 components
-# to PYTHONPATH
-if [ ${ST2_REPO_PATH} ]; then
- ST2_REPO_PATH=${ST2_REPO_PATH:-/tmp/st2}
- ST2_COMPONENTS=$(find ${ST2_REPO_PATH}/* -maxdepth 0 -name "st2*" -type d)
- PACK_PYTHONPATH="$(join ":" ${ST2_COMPONENTS}):${SENSORS_PATH}:${ACTIONS_PATH}:${ETC_PATH}"
-else
- # ST2_REPO_PATH not provided, assume all the st2 component packages are
- # already in PYTHONPATH
- PACK_PYTHONPATH="$(join ":" ${ST2_COMPONENTS}):${SENSORS_PATH}:${ACTIONS_PATH}:${ETC_PATH}"
-fi
+ # Ignore irritating urllib3 warnings while installing dependencies
+ export PYTHONWARNINGS="ignore:a true SSLContext object, ignore:an https request"
# Install st2 dependencies
if [ ${ST2_REPO_PATH} ]; then
@@ -175,6 +168,21 @@ if [ -f ${PACK_TESTS_REQUIREMENTS_FILE} ]; then
pip install --cache-dir ${HOME}/.pip-cache ${ST2_PIP_OPTIONS} -r ${PACK_TESTS_REQUIREMENTS_FILE}
fi
+ unset PYTHONWARNINGS
+fi
+
+# Note: If we are running outside of st2, we need to add all the st2 components
+# to PYTHONPATH
+if [ ${ST2_REPO_PATH} ]; then
+ ST2_REPO_PATH=${ST2_REPO_PATH:-/tmp/st2}
+ ST2_COMPONENTS=$(find ${ST2_REPO_PATH}/* -maxdepth 0 -name "st2*" -type d)
+ PACK_PYTHONPATH="$(join ":" ${ST2_COMPONENTS}):${SENSORS_PATH}:${ACTIONS_PATH}:${ETC_PATH}"
+else
+ # ST2_REPO_PATH not provided, assume all the st2 component packages are
+ # already in PYTHONPATH
+ PACK_PYTHONPATH="$(join ":" ${ST2_COMPONENTS}):${SENSORS_PATH}:${ACTIONS_PATH}:${ETC_PATH}"
+fi
+
# Set PYTHONPATH, make sure it contains st2 components in PATH
export PYTHONPATH="${PYTHONPATH}:${PACK_PYTHONPATH}"
