Enable pyenv if available in image
[releng/global-jjb.git] / .jjb-test / expected-xml / github-python-tox-verify-master
index 9cd8ea3..d04f71e 100644 (file)
@@ -258,7 +258,7 @@ virtualenv --quiet "/tmp/v/tox"
 source "/tmp/v/tox/bin/activate"
 pip install --quiet --upgrade pip
 pip install --quiet --upgrade pipdeptree
-pip install --quiet --upgrade detox tox argparse
+pip install --quiet --upgrade argparse detox tox tox-pyenv
 
 echo "----> Pip Dependency Tree"
 pipdeptree
@@ -281,9 +281,14 @@ set -e -o pipefail
 
 ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox"
 mkdir -p "$ARCHIVE_TOX_DIR"
-
 cd "$WORKSPACE/$TOX_DIR"
 
+if [ -d "/opt/pyenv" ]; then
+    echo "---> Setting up pyenv"
+    export PYENV_ROOT="/opt/pyenv"
+    export PATH="$PYENV_ROOT/bin:$PATH"
+fi
+
 if [ ! -z "$TOX_ENVS" ]; then
     detox -e "$TOX_ENVS"  | tee -a "$ARCHIVE_TOX_DIR/detox.log"
 else