Skip to content

Commit 4e42c33

Browse files
johnstcnmafredri
andauthored
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 <mafredri@gmail.com> * add comment to test-clean target --------- Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
1 parent 34c3f91 commit 4e42c33

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,22 +622,23 @@ site/.eslintignore site/.prettierignore: .prettierignore Makefile
622622
echo "$${ignore}$${rule}" >> "$@"
623623
done < "$<"
624624

625-
test: test-clean
626-
gotestsum --format standard-quiet -- -v -short ./...
625+
test:
626+
gotestsum --format standard-quiet -- -v -short -count=1 ./...
627627
.PHONY: test
628628

629629
# When updating -timeout for this test, keep in sync with
630630
# test-go-postgres (.github/workflows/coder.yaml).
631631
# Do add coverage flags so that test caching works.
632-
test-postgres: test-clean test-postgres-docker
632+
test-postgres: test-postgres-docker
633633
# The postgres test is prone to failure, so we limit parallelism for
634634
# more consistent execution.
635635
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
636636
--junitfile="gotests.xml" \
637637
--jsonfile="gotests.json" \
638638
--packages="./..." -- \
639639
-timeout=20m \
640-
-failfast
640+
-failfast \
641+
-count=1
641642
.PHONY: test-postgres
642643

643644
test-postgres-docker:
@@ -669,10 +670,13 @@ test-postgres-docker:
669670
.PHONY: test-postgres-docker
670671

671672
# Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml.
672-
test-race: test-clean
673-
gotestsum --junitfile="gotests.xml" -- -race ./...
673+
test-race:
674+
gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
674675
.PHONY: test-race
675676

677+
# Note: we used to add this to the test target, but it's not necessary and we can
678+
# achieve the desired result by specifying -count=1 in the go test invocation
679+
# instead. Keeping it here for convenience.
676680
test-clean:
677681
go clean -testcache
678682
.PHONY: test-clean

0 commit comments

Comments
 (0)