mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
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.
This commit is contained in:
parent
bad1116a28
commit
d1860fa38e
2 changed files with 3 additions and 26 deletions
4
Makefile
4
Makefile
|
|
@ -43,9 +43,9 @@ all:
|
||||||
test: all
|
test: all
|
||||||
go run build/ci.go test -failfast
|
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
|
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 certain pre-selected linters.
|
||||||
lint: ## Run linters.
|
lint: ## Run linters.
|
||||||
|
|
|
||||||
25
build/ci.go
25
build/ci.go
|
|
@ -212,7 +212,6 @@ func doTest(cmdline []string) {
|
||||||
race = flag.Bool("race", false, "Execute the race detector")
|
race = flag.Bool("race", false, "Execute the race detector")
|
||||||
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
|
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")
|
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")
|
failfast = flag.Bool("failfast", false, "Do not start new tests after the first test failure")
|
||||||
)
|
)
|
||||||
flag.CommandLine.Parse(cmdline)
|
flag.CommandLine.Parse(cmdline)
|
||||||
|
|
@ -255,21 +254,13 @@ func doTest(cmdline []string) {
|
||||||
|
|
||||||
packages := flag.CommandLine.Args()
|
packages := flag.CommandLine.Args()
|
||||||
if len(packages) > 0 {
|
if len(packages) > 0 {
|
||||||
if *quick {
|
|
||||||
packages = filterPackages(packages)
|
|
||||||
}
|
|
||||||
gotest.Args = append(gotest.Args, packages...)
|
gotest.Args = append(gotest.Args, packages...)
|
||||||
build.MustRun(gotest)
|
build.MustRun(gotest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// No packages specified, run all tests for all modules.
|
// No packages specified, run all tests for all modules.
|
||||||
if *quick {
|
gotest.Args = append(gotest.Args, "./...")
|
||||||
packages = filterPackages(build.FindAllPackages(&tc))
|
|
||||||
} else {
|
|
||||||
packages = []string{"./..."}
|
|
||||||
}
|
|
||||||
gotest.Args = append(gotest.Args, packages...)
|
|
||||||
for _, mod := range goModules {
|
for _, mod := range goModules {
|
||||||
test := *gotest
|
test := *gotest
|
||||||
test.Dir = mod
|
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.
|
// doTidy runs go mod tidy check.
|
||||||
func doTidy() {
|
func doTidy() {
|
||||||
var tc = new(build.GoToolchain)
|
var tc = new(build.GoToolchain)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue