From ec1d3e100002c82ffa444ea5ffa8c0b04d59b02b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 27 Aug 2018 14:15:56 -0700 Subject: [PATCH] Add a -race enabled build to Travis Allow it to fail for now with the goal of making it the default build in the future. --- .travis.yml | 7 +++++++ GNUmakefile | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c69d01606..afbb71181 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/GNUmakefile b/GNUmakefile index 26be2e1ca..53b7b6a7e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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