Split the heavy test packages out to their own Jobs.

This commit is contained in:
Paul Banks 2018-02-21 12:20:33 +00:00
parent 2ad083d1bd
commit 7b448fdf43
No known key found for this signature in database
GPG Key ID: C25A851A849B8221
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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