aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2024-01-25 17:13:11 +0000
committerMichael Knyszek <mknyszek@google.com>2024-02-08 16:18:55 +0000
commitf997dfd33a7f3f6d3ec11546feb69f4e10c01717 (patch)
treef0b5185ab9f6f1dec90bd5e7f2f0bd47d0a4617e
parentf29208030ab80769ce61dedb5a419821abf92113 (diff)
downloadgo-f997dfd33a7f3f6d3ec11546feb69f4e10c01717.tar.gz
go-f997dfd33a7f3f6d3ec11546feb69f4e10c01717.zip
[release-branch.go1.21] internal/testenv: allow "-noopt" anywhere in builder name in test
testenv's TestHasGoBuild test is supposed to allow noopt builders to not have go build, but the pattern match is failing on the LUCI builders where a test shard might have an additional "-test_only" suffix in the builder name. Furthermore, in the LUCI world, "run mods" (the builder type suffixes) are supposed to be well-defined and composable, so it doesn't make sense to restrict "-noopt" to the builder suffix anyway. This change modifies the test to allow "-noopt" to appear anywhere in the builder name when checking if it's running on a noopt builder. For #65470. Fixes #65472. Change-Id: I393818e3e8e452c7b0927cbc65726d552aa8ff8e Reviewed-on: https://go-review.googlesource.com/c/go/+/558596 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 93f0c0b25e7ea8ae7c2d5df32c6083cfabf2ffc2) Reviewed-on: https://go-review.googlesource.com/c/go/+/560518
-rw-r--r--src/internal/testenv/testenv_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/testenv/testenv_test.go b/src/internal/testenv/testenv_test.go
index d748e41540a..ce3b3b953b8 100644
--- a/src/internal/testenv/testenv_test.go
+++ b/src/internal/testenv/testenv_test.go
@@ -97,7 +97,7 @@ func TestHasGoBuild(t *testing.T) {
}
}
- if strings.HasSuffix(b, "-noopt") {
+ if strings.Contains(b, "-noopt") {
// The -noopt builder sets GO_GCFLAGS, which causes tests of 'go build' to
// be skipped.
t.Logf("HasGoBuild is false on %s", b)