2015-06-01 13:25:51 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
go build -o $TEMPDIR/nomad || exit 1
|
|
|
|
|
|
|
|
# Run the tests
|
|
|
|
echo "--> Running tests"
|
2016-07-11 19:49:26 +00:00
|
|
|
GOBIN="`which go`"
|
2016-07-12 06:15:42 +00:00
|
|
|
go list ./... | grep -v '^github.com/hashicorp/nomad/vendor/' | \
|
2016-07-11 19:41:14 +00:00
|
|
|
sudo \
|
|
|
|
-E PATH=$TEMPDIR:$PATH \
|
|
|
|
-E GOPATH=$GOPATH \
|
2016-07-11 20:06:00 +00:00
|
|
|
xargs $GOBIN test ${GOTEST_FLAGS:--cover -timeout=900s}
|