Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 1 addition & 24 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -255,42 +254,20 @@ 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
build.MustRun(&test)
}
}

// 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)
Expand Down