diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad30a33..faf607e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,8 +112,8 @@ jobs: go test -v -race ./... - name: E2E tests - timeout-minutes: 35 + timeout-minutes: 70 env: E2E_TESTING: 1 run: | - go test -timeout=30m -v ./... + go test -timeout=60m -v ./... diff --git a/internal/build/install_go_version.go b/internal/build/install_go_version.go index 385509a..9dc070d 100644 --- a/internal/build/install_go_version.go +++ b/internal/build/install_go_version.go @@ -13,14 +13,21 @@ import ( "github.com/hashicorp/go-version" ) +var v1_21 = version.Must(version.NewVersion("1.21")) + // installGoVersion installs given version of Go using Go // according to https://golang.org/doc/manage-install func (gb *GoBuild) installGoVersion(ctx context.Context, v *version.Version) (Go, error) { - versionString := v.Core().String() + goVersion := v.String() - // trim 0 patch versions as that's how Go does it :shrug: - shortVersion := strings.TrimSuffix(versionString, ".0") - pkgURL := fmt.Sprintf("golang.org/dl/go%s", shortVersion) + // trim 0 patch versions as that's how Go does it + // for versions prior to 1.21 + // See https://github.com/golang/go/issues/62136 + if v.LessThan(v1_21) { + versionString := v.Core().String() + goVersion = strings.TrimSuffix(versionString, ".0") + } + pkgURL := fmt.Sprintf("golang.org/dl/go%s", goVersion) gb.log().Printf("go getting %q", pkgURL) cmd := exec.CommandContext(ctx, "go", "get", pkgURL) @@ -36,7 +43,7 @@ func (gb *GoBuild) installGoVersion(ctx context.Context, v *version.Version) (Go return Go{}, fmt.Errorf("unable to install Go %s: %w\n%s", v, err, out) } - cmdName := fmt.Sprintf("go%s", shortVersion) + cmdName := fmt.Sprintf("go%s", goVersion) gb.log().Printf("downloading go %q", v) cmd = exec.CommandContext(ctx, cmdName, "download")