Skip to content

Commit 9271bbb

Browse files
committed
internal/testenv: update Builder docs with LUCI builder names
Also include some advice to avoid using this when possible. It makes tests more prone to breaking under infrastructure changes. Change-Id: Ifb2848742347eb0c937547dd888ab2cad3343f2d Reviewed-on: https://go-review.googlesource.com/c/go/+/703115 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent a4e25c3 commit 9271bbb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/internal/testenv/testenv.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ import (
3434
// environment might cause environment checks to behave erratically.
3535
var origEnv = os.Environ()
3636

37-
// Builder reports the name of the builder running this test
38-
// (for example, "linux-amd64" or "windows-386-gce").
37+
// Builder reports the name of the builder running this test. For example,
38+
// "gotip-linux-amd64_avx512-test_only" or "go1.24-windows-arm64" on LUCI,
39+
// or "linux-amd64" on our old infrastructure. Prefer using runtime.GOOS,
40+
// runtime.GOARCH, race.Enabled, reading the OS version, checking CPU
41+
// feature flags with internal/cpu, etc. over parsing builder names when
42+
// possible. When matching builder names, prefer a fuzzy match instead
43+
// of a strict comparison.
3944
// If the test is not running on the build infrastructure,
4045
// Builder returns the empty string.
4146
func Builder() string {

0 commit comments

Comments
 (0)