Merge pull request #5233 from hashicorp/f-split-slowtests

ci: run seperate build jobs for slower packages
This commit is contained in:
Nick Ethier
2019-01-23 16:31:55 -05:00
committed by GitHub
2 changed files with 28 additions and 1 deletions

View File

@@ -17,6 +17,27 @@ matrix:
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS="./api"
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS="./client"
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS="./drivers/docker"
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS="./drivers/exec"
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS="./nomad"
- os: linux
dist: xenial
sudo: required
env: GOTEST_PKGS_EXCLUDE="./api|./client|./drivers/docker|./drivers/exec|./nomad"
- os: linux
dist: xenial
sudo: required

View File

@@ -10,6 +10,12 @@ GO_TAGS =
GO_TEST_CMD = $(if $(shell which gotestsum),gotestsum --,go test)
ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined)
GOTEST_PKGS ?= "./..."
else
GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/nomad/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))$$")
endif
default: help
ifeq (,$(findstring $(THIS_OS),Darwin Linux FreeBSD Windows))
@@ -252,7 +258,7 @@ test-nomad: dev ## Run Nomad test suites
$(if $(ENABLE_RACE),-race) $(if $(VERBOSE),-v) \
-cover \
-timeout=15m \
./... $(if $(VERBOSE), >test.log ; echo $$? > exit-code)
$(GOTEST_PKGS) $(if $(VERBOSE), >test.log ; echo $$? > exit-code)
@if [ $(VERBOSE) ] ; then \
bash -C "$(PROJECT_ROOT)/scripts/test_check.sh" ; \
fi