Skip to content

Commit

Permalink
.cirrus: run -race only on non-PR branch
Browse files Browse the repository at this point in the history
Signed-off-by: flouthoc <[email protected]>
  • Loading branch information
flouthoc committed Feb 4, 2025
1 parent 0669d36 commit 6000bd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ GO_GCFLAGS := $(shell if $(GO) version|grep -q gccgo; then echo "-gccgoflags"; e
NPROCS := $(shell nproc)
export GO_BUILD=$(GO) build
export GO_TEST=$(GO) test -parallel=$(NPROCS)
#RACEFLAGS := $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race)
RACEFLAGS :=
RACEFLAGS ?= $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race)

COMMIT_NO ?= $(shell git rev-parse HEAD 2> /dev/null || true)
GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
Expand Down
8 changes: 7 additions & 1 deletion contrib/cirrus/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ else
showrun make validate
;;
unit)
showrun make test-unit
race=
if [[ -z "$CIRRUS_PR" ]]; then
# If not running on a PR then run unit tests
# with appropriate `-race` flags.
race="-race"
fi
showrun RACEFLAGS=$race make test-unit
;;
conformance)
# Typically it's undesirable to install packages at runtime.
Expand Down

0 comments on commit 6000bd1

Please sign in to comment.