From d638b246c4cf1117837664580e32d593247dc583 Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Wed, 21 Feb 2018 12:53:35 +0000 Subject: [PATCH] Travis evaluates ENV before cloning git repo and cding so we need to delay gathering packages until the makefile --- .travis.yml | 2 +- GNUmakefile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 914072e3b..ef1db8a50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: - env: GOTEST_PKGS="./api" - env: GOTEST_PKGS="./agent" - 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: - GOTEST_FLAGS="-p 3 -parallel 1" make test diff --git a/GNUmakefile b/GNUmakefile index 7c0b26b72..1a40f25bf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,7 +11,11 @@ GOTOOLS = \ GOTAGS ?= GOFILES ?= $(shell go list ./... | grep -v /vendor/) +ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined) 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) GOARCH=$(shell go env GOARCH) GOPATH=$(shell go env GOPATH)