aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDerek Marcotte <554b8425@razorfever.net>2017-10-03 16:40:22 -0400
committerDerek Marcotte <554b8425@razorfever.net>2017-10-03 16:40:22 -0400
commita6b8922a017ca19ceb82db2b6ac906614e963663 (patch)
treeccf5e00addef524b8488aa09f92c2b271706bd0e /Makefile
parent859a825bb84bf4fb911fcba445d410965945f088 (diff)
downloadprometheus_node_collector-a6b8922a017ca19ceb82db2b6ac906614e963663.tar.bz2
prometheus_node_collector-a6b8922a017ca19ceb82db2b6ac906614e963663.tar.xz
prometheus_node_collector-a6b8922a017ca19ceb82db2b6ac906614e963663.zip
Only enable race detector when GOHOSTARCH is amd64.
This enables native builds to still run the test and all targets without problems on say 386. Build failure on Buildkite build 85, prevents enabling native FreeBSD 386 builds.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b1d6d6b..4f5ebe0 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@
14GO ?= GO15VENDOREXPERIMENT=1 go 14GO ?= GO15VENDOREXPERIMENT=1 go
15GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) 15GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
16GOARCH := $(shell $(GO) env GOARCH) 16GOARCH := $(shell $(GO) env GOARCH)
17GOHOSTARCH := $(shell $(GO) env GOHOSTARCH)
17 18
18PROMU ?= $(GOPATH)/bin/promu 19PROMU ?= $(GOPATH)/bin/promu
19STATICCHECK ?= $(GOPATH)/bin/staticcheck 20STATICCHECK ?= $(GOPATH)/bin/staticcheck
@@ -26,6 +27,11 @@ DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
26MACH ?= $(shell uname -m) 27MACH ?= $(shell uname -m)
27DOCKERFILE ?= Dockerfile 28DOCKERFILE ?= Dockerfile
28 29
30ifeq ($(GOHOSTARCH),amd64)
31 # Only supported on amd64
32 test-flags := -race
33endif
34
29ifeq ($(OS),Windows_NT) 35ifeq ($(OS),Windows_NT)
30 OS_detected := Windows 36 OS_detected := Windows
31else 37else
@@ -63,7 +69,7 @@ style:
63 69
64test: collector/fixtures/sys/.unpacked 70test: collector/fixtures/sys/.unpacked
65 @echo ">> running tests" 71 @echo ">> running tests"
66 @$(GO) test -short -race $(pkgs) 72 $(GO) test -short $(test-flags) $(pkgs)
67 73
68test-32bit: collector/fixtures/sys/.unpacked 74test-32bit: collector/fixtures/sys/.unpacked
69 @echo ">> running tests in 32-bit mode" 75 @echo ">> running tests in 32-bit mode"