diff options
author | Derek Marcotte <554b8425@razorfever.net> | 2017-10-03 16:40:22 -0400 |
---|---|---|
committer | Derek Marcotte <554b8425@razorfever.net> | 2017-10-03 16:40:22 -0400 |
commit | a6b8922a017ca19ceb82db2b6ac906614e963663 (patch) | |
tree | ccf5e00addef524b8488aa09f92c2b271706bd0e /Makefile | |
parent | 859a825bb84bf4fb911fcba445d410965945f088 (diff) | |
download | prometheus_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-- | Makefile | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -14,6 +14,7 @@ | |||
14 | GO ?= GO15VENDOREXPERIMENT=1 go | 14 | GO ?= GO15VENDOREXPERIMENT=1 go |
15 | GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) | 15 | GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) |
16 | GOARCH := $(shell $(GO) env GOARCH) | 16 | GOARCH := $(shell $(GO) env GOARCH) |
17 | GOHOSTARCH := $(shell $(GO) env GOHOSTARCH) | ||
17 | 18 | ||
18 | PROMU ?= $(GOPATH)/bin/promu | 19 | PROMU ?= $(GOPATH)/bin/promu |
19 | STATICCHECK ?= $(GOPATH)/bin/staticcheck | 20 | STATICCHECK ?= $(GOPATH)/bin/staticcheck |
@@ -26,6 +27,11 @@ DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) | |||
26 | MACH ?= $(shell uname -m) | 27 | MACH ?= $(shell uname -m) |
27 | DOCKERFILE ?= Dockerfile | 28 | DOCKERFILE ?= Dockerfile |
28 | 29 | ||
30 | ifeq ($(GOHOSTARCH),amd64) | ||
31 | # Only supported on amd64 | ||
32 | test-flags := -race | ||
33 | endif | ||
34 | |||
29 | ifeq ($(OS),Windows_NT) | 35 | ifeq ($(OS),Windows_NT) |
30 | OS_detected := Windows | 36 | OS_detected := Windows |
31 | else | 37 | else |
@@ -63,7 +69,7 @@ style: | |||
63 | 69 | ||
64 | test: collector/fixtures/sys/.unpacked | 70 | test: 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 | ||
68 | test-32bit: collector/fixtures/sys/.unpacked | 74 | test-32bit: collector/fixtures/sys/.unpacked |
69 | @echo ">> running tests in 32-bit mode" | 75 | @echo ">> running tests in 32-bit mode" |