Skip to content

Commit 6a2960b

Browse files
authored
Add --rerun-fails to non-integration tests (#3869)
## Why Unrelated PR failures and merge checks slow down development.
1 parent fa13d25 commit 6a2960b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
default: checks fmt lint
22

3-
PACKAGES=./acceptance/... ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... .
3+
# gotestsum: when go test args are used with --rerun-fails the list of packages to test must be specified by the --packages flag
4+
PACKAGES=--packages "./acceptance/... ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... ."
45

56
GO_TOOL ?= go tool -modfile=tools/go.mod
67
GOTESTSUM_FORMAT ?= pkgname-and-test-fails
7-
GOTESTSUM_CMD ?= ${GO_TOOL} gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped --jsonfile test-output.json
8+
GOTESTSUM_CMD ?= ${GO_TOOL} gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped --jsonfile test-output.json --rerun-fails
89
LOCAL_TIMEOUT ?= 30m
910

1011

@@ -52,10 +53,10 @@ links:
5253
checks: tidy ws links
5354

5455
test:
55-
${GOTESTSUM_CMD} -- ${PACKAGES} -timeout=${LOCAL_TIMEOUT} -short
56+
${GOTESTSUM_CMD} ${PACKAGES} -- -timeout=${LOCAL_TIMEOUT} -short
5657

5758
test-slow:
58-
${GOTESTSUM_CMD} -- ${PACKAGES} -timeout=${LOCAL_TIMEOUT}
59+
${GOTESTSUM_CMD} ${PACKAGES} -- -timeout=${LOCAL_TIMEOUT}
5960

6061
# Updates acceptance test output (local tests)
6162
test-update:
@@ -80,7 +81,7 @@ slowest:
8081

8182
cover:
8283
rm -fr ./acceptance/build/cover/
83-
VERBOSE_TEST=1 CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES} -timeout=${LOCAL_TIMEOUT}
84+
VERBOSE_TEST=1 CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} ${PACKAGES} -- -coverprofile=coverage.txt -timeout=${LOCAL_TIMEOUT}
8485
rm -fr ./acceptance/build/cover-merged/
8586
mkdir -p acceptance/build/cover-merged/
8687
go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//') -o acceptance/build/cover-merged/

0 commit comments

Comments
 (0)