From d1860fa38e33c8f18f134029620b8a4c9a823306 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 10 Mar 2026 21:17:49 +0800 Subject: [PATCH] test(build,Makefile): switch quick-test from --quick to -short (#2130) Replace the quick-test target to run `go run build/ci.go test -short -failfast`. Remove the `--quick` flag and package-filter path from `build/ci.go`, so test selection relies on Go's built-in short mode instead of custom package exclusion. This keeps quick-test behavior aligned with tests guarded by `testing.Short()` and avoids maintaining bespoke skip logic in CI tooling. --- Makefile | 4 ++-- build/ci.go | 25 +------------------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 78eb8dc4e1..7f9d6bc6f2 100644 --- a/Makefile +++ b/Makefile @@ -43,9 +43,9 @@ all: test: all go run build/ci.go test -failfast -#? quick-test: Run the tests except time-consuming packages. +#? quick-test: Run tests in short mode (testing.Short()), fail fast. quick-test: all - go run build/ci.go test --quick -failfast + go run build/ci.go test -short -failfast #? lint: Run certain pre-selected linters. lint: ## Run linters. diff --git a/build/ci.go b/build/ci.go index ce58cdf3ae..1cceb49d07 100644 --- a/build/ci.go +++ b/build/ci.go @@ -212,7 +212,6 @@ func doTest(cmdline []string) { race = flag.Bool("race", false, "Execute the race detector") short = flag.Bool("short", false, "Pass the 'short'-flag to go test") threads = flag.Int("p", 1, "Number of CPU threads to use for testing") - 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) @@ -255,21 +254,13 @@ func doTest(cmdline []string) { packages := flag.CommandLine.Args() if len(packages) > 0 { - if *quick { - packages = filterPackages(packages) - } gotest.Args = append(gotest.Args, packages...) build.MustRun(gotest) return } // No packages specified, run all tests for all modules. - if *quick { - packages = filterPackages(build.FindAllPackages(&tc)) - } else { - packages = []string{"./..."} - } - gotest.Args = append(gotest.Args, packages...) + gotest.Args = append(gotest.Args, "./...") for _, mod := range goModules { test := *gotest test.Dir = mod @@ -277,20 +268,6 @@ func doTest(cmdline []string) { } } -// filterPackages removes time-consuming packages. -func filterPackages(packages []string) []string { - var filtered []string - - for _, pkg := range packages { - if strings.Contains(pkg, "/consensus/tests/engine_v2_tests") { - continue - } - filtered = append(filtered, pkg) - } - - return filtered -} - // doTidy runs go mod tidy check. func doTidy() { var tc = new(build.GoToolchain)