From 4e42c33769c0ecf197ed96543ccc6a304a2da8b3 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 7 Jul 2023 12:16:16 +0100 Subject: [PATCH] chore(Makefile): specify count=1 instead of cleaning test cache (#8359) * chore(Makefile): specify count=1 instead of cleaning test cache * Update Makefile Co-authored-by: Mathias Fredriksson * add comment to test-clean target --------- Co-authored-by: Mathias Fredriksson --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 84f2ceebb3..66e6eb35bf 100644 --- a/Makefile +++ b/Makefile @@ -622,14 +622,14 @@ site/.eslintignore site/.prettierignore: .prettierignore Makefile echo "$${ignore}$${rule}" >> "$@" done < "$<" -test: test-clean - gotestsum --format standard-quiet -- -v -short ./... +test: + gotestsum --format standard-quiet -- -v -short -count=1 ./... .PHONY: test # When updating -timeout for this test, keep in sync with # test-go-postgres (.github/workflows/coder.yaml). # Do add coverage flags so that test caching works. -test-postgres: test-clean test-postgres-docker +test-postgres: test-postgres-docker # The postgres test is prone to failure, so we limit parallelism for # more consistent execution. DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \ @@ -637,7 +637,8 @@ test-postgres: test-clean test-postgres-docker --jsonfile="gotests.json" \ --packages="./..." -- \ -timeout=20m \ - -failfast + -failfast \ + -count=1 .PHONY: test-postgres test-postgres-docker: @@ -669,10 +670,13 @@ test-postgres-docker: .PHONY: test-postgres-docker # Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml. -test-race: test-clean - gotestsum --junitfile="gotests.xml" -- -race ./... +test-race: + gotestsum --junitfile="gotests.xml" -- -race -count=1 ./... .PHONY: test-race +# Note: we used to add this to the test target, but it's not necessary and we can +# achieve the desired result by specifying -count=1 in the go test invocation +# instead. Keeping it here for convenience. test-clean: go clean -testcache .PHONY: test-clean