X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-analyses%2Fbuild.sh;h=a0f5e8922adcc903ada9c0e0e1917776cffa1f90;hb=15314957e8bd75a89f30bdded6142ae92e4b22a2;hp=d0509fbceceab5375afc0a260031ff92f07519bd;hpb=4f4f6150a72761b7e8d1ff6de0924e81ead3c158;p=lttng-ci.git diff --git a/scripts/lttng-analyses/build.sh b/scripts/lttng-analyses/build.sh index d0509fb..a0f5e89 100755 --- a/scripts/lttng-analyses/build.sh +++ b/scripts/lttng-analyses/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh -exu +#!/bin/bash -exu # # Copyright (C) 2015 - Michael Jeanson # @@ -15,6 +15,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Has to be set in the environment +#CODECOV_TOKEN="" + +SRCDIR="src/lttng-analyses" + PYTHON3="python3" P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") @@ -22,19 +27,39 @@ BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build export LD_LIBRARY_PATH="$BABELTRACE_DIR/lib" export PYTHONPATH="$BABELTRACE_DIR/lib/python${P3_VERSION}/dist-packages/" +export PATH="$PATH:$BABELTRACE_DIR/bin" PYENV_HOME=$WORKSPACE/.pyenv/ # Delete previously built virtualenv -if [ -d $PYENV_HOME ]; then - rm -rf $PYENV_HOME +if [ -d "$PYENV_HOME" ]; then + rm -rf "$PYENV_HOME" fi # Create virtualenv and install necessary packages -virtualenv --system-site-packages -p $PYTHON3 $PYENV_HOME +virtualenv --system-site-packages -p $PYTHON3 "$PYENV_HOME" + +set +ux +. "$PYENV_HOME/bin/activate" +set -ux + +pip install --quiet codecov +pip install --quiet tox + +cd "$SRCDIR" + +# Hack for path too long in venv wrapper shebang +TOXWORKDIR=$(mktemp -d) +export TOXWORKDIR + +# Run base test suites and long regression test suite +for suite in py3 noutf8 pep8 longregression; do + export TOXENV="$suite" + tox + codecov -e TOXENV +done -set +u -. $PYENV_HOME/bin/activate -set -u +unset TOXENV +rm -rf "$TOXWORKDIR" -pip install . +# EOF