Cache build deps prior to running tests

This commit is contained in:
Michael Schurter
2017-01-25 10:54:08 -08:00
parent c5f9144e32
commit 2f0550cfc4
2 changed files with 8 additions and 3 deletions

View File

@@ -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"

View File

@@ -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=$!