Travis evaluates ENV before cloning git repo and cding so we need to delay gathering packages until the makefile

This commit is contained in:
Paul Banks 2018-02-21 12:53:35 +00:00
parent ed2ef973d6
commit d638b246c4
No known key found for this signature in database
GPG Key ID: C25A851A849B8221
2 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,7 @@ matrix:
- env: GOTEST_PKGS="./api" - env: GOTEST_PKGS="./api"
- env: GOTEST_PKGS="./agent" - env: GOTEST_PKGS="./agent"
- env: GOTEST_PKGS="./agent/consul" - env: GOTEST_PKGS="./agent/consul"
- env: GOTEST_PKGS="$(go list ./... | sed 's/github.com\/hashicorp\/consul/./' | egrep -v './agent|./agent/consul|./api')" - env: GOTEST_PKGS_EXCLUDE="./api|./agent|./agent/consul"
script: script:
- GOTEST_FLAGS="-p 3 -parallel 1" make test - GOTEST_FLAGS="-p 3 -parallel 1" make test

View File

@ -11,7 +11,11 @@ GOTOOLS = \
GOTAGS ?= GOTAGS ?=
GOFILES ?= $(shell go list ./... | grep -v /vendor/) GOFILES ?= $(shell go list ./... | grep -v /vendor/)
ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined)
GOTEST_PKGS ?= "./..." GOTEST_PKGS ?= "./..."
else
GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/consul/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))$$")
endif
GOOS=$(shell go env GOOS) GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH) GOARCH=$(shell go env GOARCH)
GOPATH=$(shell go env GOPATH) GOPATH=$(shell go env GOPATH)