Skip to content

Commit

Permalink
Build consul to a temp dir for API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanuber committed Apr 11, 2015
1 parent a54e867 commit 9bdf570
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ updatedeps: deps
@go get -d -f -u ./... $(DEPS)

test: deps
./scripts/verify_no_uuid.sh
go list ./... | xargs -n1 go test
@./scripts/verify_no_uuid.sh
@./scripts/test.sh
@$(MAKE) vet

integ:
Expand Down
13 changes: 13 additions & 0 deletions scripts/test.sh
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

0 comments on commit 9bdf570

Please sign in to comment.