forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build consul to a temp dir for API tests
- Loading branch information
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Create a temp dir and clean it up on exit | ||
TEMPDIR=`mktemp -d -t consul-test` | ||
trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM | ||
|
||
# Build the Consul binary for the API tests | ||
echo "--> Building consul" | ||
go build -o $TEMPDIR/consul || exit 1 | ||
|
||
# Run the tests | ||
echo "--> Running tests" | ||
go list ./... | PATH=$TEMPDIR:$PATH xargs -n1 go test |