Merge pull request #4620 from hashicorp/f-optional-race

Add a -race enabled build to Travis
This commit is contained in:
Michael Schurter 2018-08-31 14:03:28 -07:00 committed by GitHub
commit 36073157fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -17,6 +17,10 @@ matrix:
- os: linux
dist: trusty
sudo: required
- os: linux
dist: trusty
sudo: required
env: ENABLE_RACE=1
- os: linux
dist: trusty
sudo: false
@ -28,7 +32,10 @@ matrix:
- os: osx
osx_image: xcode9.1
allow_failures:
# Allow osx to fail as its flaky
- os: osx
#FIXME Allow race enabled builds to fail for now.
- env: ENABLE_RACE=1
fast_finish: true
before_install:

View file

@ -244,10 +244,11 @@ test: ## Run the Nomad test suite and/or the Nomad UI test suite
.PHONY: test-nomad
test-nomad: dev ## Run Nomad test suites
@echo "==> Running Nomad test suites:"
@go test $(if $(VERBOSE),-v) \
-cover \
-timeout=900s \
-tags="$(if $(HAS_LXC),lxc)" ./... $(if $(VERBOSE), >test.log ; echo $$? > exit-code)
$(if $(ENABLE_RACE),GORACE="strip_path_prefix=$(GOPATH)/src") go test \
$(if $(ENABLE_RACE),-race) $(if $(VERBOSE),-v) \
-cover \
-timeout=900s \
-tags="$(if $(HAS_LXC),lxc)" ./... $(if $(VERBOSE), >test.log ; echo $$? > exit-code)
@if [ $(VERBOSE) ] ; then \
bash -C "$(PROJECT_ROOT)/scripts/test_check.sh" ; \
fi