diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2025-09-11 23:32:40 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2025-09-12 07:19:46 -0700 |
| commit | 9271bbbb802f0d5863b78cbac38292321a5b0833 (patch) | |
| tree | 9187f056d821a532a6fcfdb5ac8c013e2136db4e /src/internal/testenv | |
| parent | a4e25c3d657cf7c3f3a921cc99ea60ad5a337b82 (diff) | |
| download | go-9271bbbb802f0d5863b78cbac38292321a5b0833.tar.xz | |
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/internal/testenv')
| -rw-r--r-- | src/internal/testenv/testenv.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index 0f6c9bbdad..947340ce83 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -34,8 +34,13 @@ import ( // environment might cause environment checks to behave erratically. var origEnv = os.Environ() -// Builder reports the name of the builder running this test -// (for example, "linux-amd64" or "windows-386-gce"). +// Builder reports the name of the builder running this test. For example, +// "gotip-linux-amd64_avx512-test_only" or "go1.24-windows-arm64" on LUCI, +// or "linux-amd64" on our old infrastructure. Prefer using runtime.GOOS, +// runtime.GOARCH, race.Enabled, reading the OS version, checking CPU +// feature flags with internal/cpu, etc. over parsing builder names when +// possible. When matching builder names, prefer a fuzzy match instead +// of a strict comparison. // If the test is not running on the build infrastructure, // Builder returns the empty string. func Builder() string { |
