From 7df40581bee221ca9f5429c95630f4eca1cfaf15 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 7 Jul 2023 11:28:24 +0100 Subject: [PATCH 1/3] chore(Makefile): specify count=1 instead of cleaning test cache --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 84f2ceebb3386..d1f6260e956b4 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 \ @@ -638,6 +638,7 @@ test-postgres: test-clean test-postgres-docker --packages="./..." -- \ -timeout=20m \ -failfast + -count=1 .PHONY: test-postgres test-postgres-docker: @@ -669,8 +670,8 @@ 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 test-clean: From e7ec26d6d76f2b11b47832c941426a32450d0465 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 7 Jul 2023 11:32:41 +0100 Subject: [PATCH 2/3] Update Makefile Co-authored-by: Mathias Fredriksson --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d1f6260e956b4..b455ffa1b7cb9 100644 --- a/Makefile +++ b/Makefile @@ -637,7 +637,7 @@ test-postgres: test-postgres-docker --jsonfile="gotests.json" \ --packages="./..." -- \ -timeout=20m \ - -failfast + -failfast \ -count=1 .PHONY: test-postgres From 0f0b93c881f4a51bfdc26e8d4debe121b723ebe1 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 7 Jul 2023 11:34:51 +0100 Subject: [PATCH 3/3] add comment to test-clean target --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index b455ffa1b7cb9..66e6eb35bfca8 100644 --- a/Makefile +++ b/Makefile @@ -674,6 +674,9 @@ 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