Skip to content

Commit 93f0c0b

Browse files
committed
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. Change-Id: I393818e3e8e452c7b0927cbc65726d552aa8ff8e Reviewed-on: https://go-review.googlesource.com/c/go/+/558596 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent 9312f47 commit 93f0c0b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/internal/testenv/testenv_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func TestHasGoBuild(t *testing.T) {
9797
}
9898
}
9999

100-
if strings.HasSuffix(b, "-noopt") {
100+
if strings.Contains(b, "-noopt") {
101101
// The -noopt builder sets GO_GCFLAGS, which causes tests of 'go build' to
102102
// be skipped.
103103
t.Logf("HasGoBuild is false on %s", b)

0 commit comments

Comments
 (0)