From 2f0550cfc4bc8e8ecc745174a10cee25fcec136f Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 25 Jan 2017 10:54:08 -0800 Subject: [PATCH] Cache build deps prior to running tests --- scripts/test.sh | 9 +++++++-- scripts/travis.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 097003e76..bc163dd6b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash set -e -GOTEST_TAGS="nomad_test lxc" +GOTEST_TAGS="nomad_test" +if [[ $(uname) == "Linux" ]]; then + if pkg-config --exists lxc; then + GOTEST_TAGS="$GOTEST_TAGS lxc" + fi +fi # Create a temp dir and clean it up on exit TEMPDIR=`mktemp -d -t nomad-test.XXX` @@ -9,7 +14,7 @@ trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM # Build the Nomad binary for the API tests echo "--> Building nomad" -go build -tags "$GOTEST_TAGS" -o $TEMPDIR/nomad || exit 1 +go build -i -tags "$GOTEST_TAGS" -o $TEMPDIR/nomad || exit 1 # Run the tests echo "--> Running tests" diff --git a/scripts/travis.sh b/scripts/travis.sh index 4bb85a1f2..bc181faae 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -export PING_SLEEP=30 +export PING_SLEEP=60 bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" & PING_LOOP_PID=$!