Files
nomad/scripts/test.sh
Sean Chittenden 1e6c04ccfa Remove xargs(1) from testing and rely on go test -v.
Tests are approaching 30min largely due to recompiling every package.
Out of a ~30min build, only ~5min are actually spent running the tests,
the remaining time is spent recompiling.
2016-07-11 12:31:21 -07:00

14 lines
412 B
Bash
Executable File

#!/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"
go list ./... | grep -v '/vendor/' | sudo -E PATH=$TEMPDIR:$PATH go test ${GOTEST_FLAGS:--cover -timeout=900s -v}