From 62f05720140793e7f79c702eda016152b7bd7651 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 15 Dec 2017 15:56:26 -0500 Subject: [PATCH] Fix: use temp dir for base venv Tox have difficulty with long base venv python path on standalone node. Do not use -e from bash to make sure all cleanup command are run. Signed-off-by: Jonathan Rajotte --- scripts/lttng-ivc/build.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/lttng-ivc/build.sh b/scripts/lttng-ivc/build.sh index 0214648..8cc08ac 100644 --- a/scripts/lttng-ivc/build.sh +++ b/scripts/lttng-ivc/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash -exu +#!/bin/bash -xu # # Copyright (C) 2017 - Jonathan Rajotte-Julien # @@ -26,12 +26,9 @@ export LD_LIBRARY_PATH="$URCU_LIBS:${LD_LIBRARY_PATH:-}" export CPPFLAGS="${CPPFLAGS:-} -I$URCU_INCS" export LDFLAGS="${LDFLAGS:-} -L$URCU_LIBS" -PYENV_HOME=$WORKSPACE/.pyenv/ +# Tox does not support long path venv for whatever reason. +PYENV_HOME=$(mktemp -d) -# Delete previously built virtualenv if any -if [ -d "$PYENV_HOME" ]; then - rm -rf "$PYENV_HOME" -fi # Create virtualenv and install necessary packages virtualenv --system-site-packages -p $PYTHON3 "$PYENV_HOME" @@ -49,9 +46,10 @@ export TOXWORKDIR cd src/ # Run test suite via tox -set +e tox -v -- --junit-xml="${WORKSPACE}/result.xml" -set -e + +# Remove base venv +rm -rf "$PYENV_HOME" # Save cp -r "$TOXWORKDIR" "${WORKSPACE}/artifacts" -- 2.34.1