jjb: fix lttng-analyses tox build
[lttng-ci.git] / scripts / lttng-analyses / build.sh
index f5b412eac213e8f069e268f61862f0ecea793442..ef19043d64836f194b2ffb1450cb06fa65107e1d 100755 (executable)
@@ -15,6 +15,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Has to be set in the environment
+#CODECOV_TOKEN=""
+
 SRCDIR="src/lttng-analyses"
 
 PYTHON3="python3"
@@ -29,19 +32,34 @@ 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
 
-set +u
-. $PYENV_HOME/bin/activate
-set -u
+pip install --quiet codecov
+pip install --quiet tox
 
 cd "$SRCDIR"
 
-$PYTHON3 setup.py build
-$PYTHON3 setup.py test
-$PYTHON3 setup.py install
+# 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
+
+unset TOXENV
+rm -rf "$TOXWORKDIR"
+
+# EOF
This page took 0.022483 seconds and 4 git commands to generate.