all: replace os.Getenv("GO_BUILDER_NAME") with testenv.Builder in tests

Some tests still reach for GO_BUILDER_NAME directly. This change makes
it so that they go through testenv.Builder.

There are a couple more, but changing them may also cause tests to start
failing. Done in a follow-up.

Change-Id: Id2453b7b62f5ebf3594e92fa53724a577a97440f
Reviewed-on: https://go-review.googlesource.com/c/go/+/703135
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Michael Anthony Knyszek 2025-09-11 23:48:04 +00:00 committed by Michael Knyszek
parent dbde15800c
commit 004858ccdd
6 changed files with 8 additions and 7 deletions

View file

@ -44,7 +44,7 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int {
log.SetFlags(log.Lshortfile)
flag.Parse()
if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t *testing.T) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run()
}