2015-06-01 13:25:51 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-08-19 23:32:41 +00:00
|
|
|
set -e
|
2015-06-01 13:25:51 +00:00
|
|
|
|
|
|
|
# Create a temp dir and clean it up on exit
|
|
|
|
TEMPDIR=`mktemp -d -t nomad-test.XXX`
|
|
|
|
trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM
|
|
|
|
|
|
|
|
# Build the Nomad binary for the API tests
|
|
|
|
echo "--> Building nomad"
|
2016-08-22 20:02:28 +00:00
|
|
|
go build -tags "nomad_test" -o $TEMPDIR/nomad || exit 1
|
2015-06-01 13:25:51 +00:00
|
|
|
|
|
|
|
# Run the tests
|
|
|
|
echo "--> Running tests"
|
2016-07-11 19:49:26 +00:00
|
|
|
GOBIN="`which go`"
|
2016-08-16 19:32:29 +00:00
|
|
|
sudo -E PATH=$TEMPDIR:$PATH -E GOPATH=$GOPATH \
|
2016-09-21 21:21:37 +00:00
|
|
|
$GOBIN test -tags "nomad_test" ${GOTEST_FLAGS:--cover -timeout=900s} $($GOBIN list ./... | grep -v /vendor/)
|
2016-08-16 19:32:29 +00:00
|
|
|
|