Skip to content

Commit cb418dd

Browse files
committed
test: make -all_codegen default to true on linux-amd64 builder
Fixes #34297 Change-Id: I4584a97d4562d7af0412d683ba1c206e3c1d9edb Reviewed-on: https://go-review.googlesource.com/c/go/+/197539 Run-TryBot: Brad Fitzpatrick <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent a37f2b4 commit cb418dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/run.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var (
3434
keep = flag.Bool("k", false, "keep. keep temporary directory.")
3535
numParallel = flag.Int("n", runtime.NumCPU(), "number of parallel tests to run")
3636
summary = flag.Bool("summary", false, "show summary of results")
37-
allCodegen = flag.Bool("all_codegen", false, "run all goos/goarch for codegen")
37+
allCodegen = flag.Bool("all_codegen", defaultAllCodeGen(), "run all goos/goarch for codegen")
3838
showSkips = flag.Bool("show_skips", false, "show skipped tests")
3939
runSkips = flag.Bool("run_skips", false, "run skipped tests (ignore skip and build tags)")
4040
linkshared = flag.Bool("linkshared", false, "")
@@ -45,6 +45,14 @@ var (
4545
shards = flag.Int("shards", 0, "number of shards. If 0, all tests are run. This is used by the continuous build.")
4646
)
4747

48+
// defaultAllCodeGen returns the default value of the -all_codegen
49+
// flag. By default, we prefer to be fast (returning false), except on
50+
// the linux-amd64 builder that's already very fast, so we get more
51+
// test coverage on trybots. See https://golang.org/issue/34297.
52+
func defaultAllCodeGen() bool {
53+
return os.Getenv("GO_BUILDER_NAME") == "linux-amd64"
54+
}
55+
4856
var (
4957
goos, goarch string
5058

0 commit comments

Comments
 (0)