Merge pull request #3103 from hashicorp/fail-for-sure

Makes test target fail based on return code from go test.
This commit is contained in:
James Phillips 2017-06-02 15:10:45 -07:00 committed by GitHub
commit 4f212570e3
1 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ cov:
test: dev
go test -tags "$(GOTAGS)" -i -run '^$$' ./...
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep -v '(consul/consul|vendor)') > test.log 2>&1 || true
go test -tags "$(GOTAGS)" -v github.com/hashicorp/consul/consul >> test.log 2>&1 || true
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep -v '(consul/consul|vendor)') > test.log 2>&1 || echo 'FAIL_TOKEN' >> test.log
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep '(consul/consul)') >> test.log 2>&1 || echo 'FAIL_TOKEN' >> test.log
@if [ "$$TRAVIS" == "true" ] ; then cat test.log ; fi
@if grep -q 'FAIL:' test.log ; then grep 'FAIL:' test.log ; exit 1 ; else echo 'PASS' ; fi
@if grep -q 'FAIL_TOKEN' test.log ; then grep 'FAIL:' test.log ; exit 1 ; else echo 'PASS' ; fi
test-race: dev
go test -tags "$(GOTAGS)" -i -run '^$$' ./...