From 7699e9e0f227cf75f171d44ecf71f54a742a706a Mon Sep 17 00:00:00 2001 From: Jacek Kaniuk Date: Fri, 12 Apr 2019 11:37:31 +0200 Subject: [PATCH] Enable race detection in unit tests --- cluster-autoscaler/Makefile | 2 +- hack/for-go-proj.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/Makefile b/cluster-autoscaler/Makefile index b6ce9d08bcd..b880087290f 100644 --- a/cluster-autoscaler/Makefile +++ b/cluster-autoscaler/Makefile @@ -67,7 +67,7 @@ container: build-in-docker make-image @echo "Created in-docker image ${TAG}${FOR_PROVIDER}" test-in-docker: clean docker-builder - docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/ autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && godep go test ./... ${TAGS_FLAG}' + docker run -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/ autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && godep go test -race ./... ${TAGS_FLAG}' .PHONY: all deps build test-unit clean format execute-release dev-release docker-builder build-in-docker release generate diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index 4991497d6b7..7f907d3581c 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -49,7 +49,7 @@ for godep_file in ${godep_projects}; do cd "${project}" case "${CMD}" in "test") - godep go "${CMD}" $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e ) + godep go test -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e ) ;; *) godep go "${CMD}" ./...