From 0fc4c82350cfeea3b60ce4dd6aa9a48a20821ba5 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Sat, 15 Nov 2025 19:12:35 +0800 Subject: [PATCH] Makefile, build: make test fast fail (#1739) --- Makefile | 4 ++-- build/ci.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 67060859ca..8a0faf49f7 100644 --- a/Makefile +++ b/Makefile @@ -43,11 +43,11 @@ all: #? test: Run the tests. test: all - go run build/ci.go test + go run build/ci.go test -failfast #? quick-test: Run the tests except time-consuming tests. quick-test: all - go run build/ci.go test --quick + go run build/ci.go test --quick -failfast #? lint: Run certain pre-selected linters. lint: ## Run linters. diff --git a/build/ci.go b/build/ci.go index 2d61d70a9b..8915c383c3 100644 --- a/build/ci.go +++ b/build/ci.go @@ -223,6 +223,7 @@ func doTest(cmdline []string) { coverage := flag.Bool("coverage", false, "Whether to record code coverage") verbose := flag.Bool("v", false, "Whether to log verbosely") quick := flag.Bool("quick", false, "Whether to skip long time test") + failfast := flag.Bool("failfast", false, "Do not start new tests after the first test failure") flag.CommandLine.Parse(cmdline) env := build.Env() @@ -249,6 +250,9 @@ func doTest(cmdline []string) { if *verbose { gotest.Args = append(gotest.Args, "-v") } + if *failfast { + gotest.Args = append(gotest.Args, "-failfast") + } gotest.Args = append(gotest.Args, packages...) build.MustRun(gotest)