Upgrade to Go 1.22.1

Closes #12250
This commit is contained in:
Bjørn Erik Pedersen
2024-03-14 20:25:16 +01:00
parent b1f8676347
commit 57206e7274
10 changed files with 114 additions and 56 deletions

View File

@@ -54,8 +54,8 @@ func TestGoToolLocation(t *testing.T) {
}
}
// Modified by Hugo.
func TestHasGoBuild(t *testing.T) {
// Removed by Hugo.
}
func TestMustHaveExec(t *testing.T) {
@@ -73,7 +73,7 @@ func TestMustHaveExec(t *testing.T) {
t.Errorf("expected MustHaveExec to skip on %v", runtime.GOOS)
}
case "ios":
if b := testenv.Builder(); strings.HasSuffix(b, "-corellium") && !hasExec {
if b := testenv.Builder(); isCorelliumBuilder(b) && !hasExec {
// Most ios environments can't exec, but the corellium builder can.
t.Errorf("expected MustHaveExec not to skip on %v", b)
}
@@ -106,3 +106,23 @@ func TestCleanCmdEnvPWD(t *testing.T) {
}
t.Error("PWD not set in cmd.Env")
}
func isCorelliumBuilder(builderName string) bool {
// Support both the old infra's builder names and the LUCI builder names.
// The former's names are ad-hoc so we could maintain this invariant on
// the builder side. The latter's names are structured, and "corellium" will
// appear as a "host" suffix after the GOOS and GOARCH, which always begin
// with an underscore.
return strings.HasSuffix(builderName, "-corellium") || strings.Contains(builderName, "_corellium")
}
func isEmulatedBuilder(builderName string) bool {
// Support both the old infra's builder names and the LUCI builder names.
// The former's names are ad-hoc so we could maintain this invariant on
// the builder side. The latter's names are structured, and the signifier
// of emulation "emu" will appear as a "host" suffix after the GOOS and
// GOARCH because it modifies the run environment in such a way that it
// the target GOOS and GOARCH may not match the host. This suffix always
// begins with an underscore.
return strings.HasSuffix(builderName, "-emu") || strings.Contains(builderName, "_emu")
}