From 80dd47d7d64adf1e436aa016a14ee7e9c1c9fb52 Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Wed, 4 Mar 2020 19:31:55 +0100 Subject: [PATCH] Remove usage of -race flag in tests for 32 bit architectures because it's not supported there --- Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d489c019a..e46682f17 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,25 @@ DOCKER_NETWORK?=SKYNET DOCKER_NODE?=SKY01 DOCKER_OPTS?=GO111MODULE=on GOOS=linux # go options for compiling for docker container -GO_VERSION=$(shell go version) +TEST_OPTS_BASE:=-cover -timeout=1m + +RACE_FLAG:=-race +GOARCH:=$(shell go env GOARCH) + +ifneq (,$(findstring 64,$(GOARCH))) + TEST_OPTS_BASE:=$(TEST_OPTS_BASE) $(RACE_FLAG) +endif + # TODO: Remove after https://github.com/etcd-io/bbolt/pull/201 is closed. -DISABLE_CHECKPTR=-gcflags=all=-d=checkptr=0 -OPTIONAL_FLAGS= +GO_VERSION:=$(shell go version) +DISABLE_CHECKPTR_FLAG:=-gcflags=all=-d=checkptr=0 + ifneq (,$(findstring go1.14,$(GO_VERSION))) - OPTIONAL_FLAGS=$(DISABLE_CHECKPTR) + TEST_OPTS_BASE:=$(TEST_OPTS_BASE) $(DISABLE_CHECKPTR_FLAG) endif -TEST_OPTS?=-race $(OPTIONAL_FLAGS) -tags no_ci -cover -timeout=5m -TEST_OPTS_NOCI?=-race $(OPTIONAL_FLAGS) -cover -timeout=5m -v +TEST_OPTS_NOCI:=-$(TEST_OPTS_BASE) -v +TEST_OPTS:=$(TEST_OPTS_BASE) -tags no_ci BUILDINFO_PATH := $(PROJECT_BASE)/pkg/util/buildinfo