From 25ac71b8b5fe410d5fc0d3b1520a4e61682ceda0 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Mon, 11 Jul 2016 12:49:26 -0700 Subject: [PATCH] When sudo(1)'ing to run the tests, use the abspath of the current user's go(1) instead of whatever is in root's PATH. --- scripts/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 719b32872..56e760420 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -10,9 +10,9 @@ go build -o $TEMPDIR/nomad || exit 1 # Run the tests echo "--> Running tests" -printf "go(1) path: %s\n" "`which go`" +GOBIN="`which go`" go list ./... | grep -v '/vendor/' | \ sudo \ -E PATH=$TEMPDIR:$PATH \ -E GOPATH=$GOPATH \ - go test ${GOTEST_FLAGS:--cover -timeout=900s -v} + $GOBIN test ${GOTEST_FLAGS:--cover -timeout=900s -v}