github.com/maier/nomad@v0.4.1-0.20161110003312-a9e3d0b8549d/scripts/test.sh (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  GOTEST_TAGS="nomad_test lxc"
     5  
     6  # Create a temp dir and clean it up on exit
     7  TEMPDIR=`mktemp -d -t nomad-test.XXX`
     8  trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM
     9  
    10  # Build the Nomad binary for the API tests
    11  echo "--> Building nomad"
    12  go build -tags "$GOTEST_TAGS" -o $TEMPDIR/nomad || exit 1
    13  
    14  # Run the tests
    15  echo "--> Running tests"
    16  GOBIN="`which go`"
    17  sudo -E PATH=$TEMPDIR:$PATH  -E GOPATH=$GOPATH   -E NOMAD_TEST_RKT=1 \
    18      $GOBIN test -tags "$GOTEST_TAGS" ${GOTEST_FLAGS:--cover -timeout=900s} $($GOBIN list ./... | grep -v /vendor/)
    19