diff --git a/.travis.yml b/.travis.yml index df04206ed9..f68a9619d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,14 @@ branches: only: - master +matrix: + include: + - env: GOTEST_FLAGS="-p 1 -parallel 1" GOTEST_PKGS="./api" + - env: GOTEST_FLAGS="-p 1 -parallel 1" GOTEST_PKGS="./agent" + - env: GOTEST_FLAGS="-p 1 -parallel 1" GOTEST_PKGS="./agent/consul" + - env: GOTEST_FLAGS="-p 3 -parallel 1" GOTEST_PKGS="$(go list ./... | egrep -v '(/agent|/agent/consul|/api)$')" + script: - - GOTEST_FLAGS="-p 3 -parallel 1" make test + - make test sudo: true diff --git a/GNUmakefile b/GNUmakefile index 5c64d4d708..7c0b26b72c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,6 +11,7 @@ GOTOOLS = \ GOTAGS ?= GOFILES ?= $(shell go list ./... | grep -v /vendor/) +GOTEST_PKGS ?= "./..." GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) GOPATH=$(shell go env GOPATH) @@ -66,12 +67,12 @@ cov: test: other-consul dev-build vet @echo "--> Running go test" @rm -f test.log exit-code - go test -tags '$(GOTAGS)' -i ./... + go test -tags '$(GOTAGS)' -i $(GOTEST_PKGS) @# Dump verbose output to test.log so we can surface test names on failure but @# hide it from travis as it exceeds their log limits and causes job to be @# terminated (over 4MB and over 10k lines in the UI). We need to output @# _something_ to stop them terminating us due to inactivity... - { go test $(GOTEST_FLAGS) -tags '$(GOTAGS)' -timeout 5m ./... 2>&1 ; echo $$? > exit-code ; } | tee test.log | egrep '^(ok|FAIL)\s*github.com/hashicorp/consul' + { go test $(GOTEST_FLAGS) -tags '$(GOTAGS)' -timeout 5m $(GOTEST_PKGS) 2>&1 ; echo $$? > exit-code ; } | tee test.log | egrep '^(ok|FAIL)\s*github.com/hashicorp/consul' @echo "Exit code: $$(cat exit-code)" >> test.log @grep -A5 'DATA RACE' test.log || true @grep -A10 'panic: test timed out' test.log || true