From dfecaace7db2127c13d6b0fc077b643c7917ef6e Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Sat, 17 Feb 2024 03:32:01 +1100 Subject: [PATCH] Use go1.20.14 for DefaultVersion (#540) * Use go1.20.14 for DefaultVersion * Specify goVersion for tests not using the default * Specify goVersion for old govendor fixtures * Specify GOVERSION for old GB tests * Drop godep-devel-go tests These attempt to install a very old Go version that can't be compiled with modern go versions (like the bootstrapped go version). * Specify goVersion for old govendor fixtures * Specify go-version for old dep fixtures * specify GOVERSION for old glide tests * Specify GOVERSION for pack glide tests * Specify GOVERSION for old glide test * Update changelog wording --------- Co-authored-by: Josh W Lewis --- CHANGELOG.md | 2 + data.json | 2 +- test/fixtures/dep-golang-migrate/Gopkg.toml | 1 + test/fixtures/dep-install-multi/Gopkg.toml | 1 + test/fixtures/dep-mattes-migrate/Gopkg.toml | 1 + test/fixtures/dep-no-deps/Gopkg.toml | 1 + test/fixtures/dep-no-ensure/Gopkg.toml | 1 + test/fixtures/dep-with-dep-pruned/Gopkg.toml | 3 +- test/fixtures/dep-with-dep/Gopkg.toml | 3 +- .../godep-devel-go/Godeps/Godeps.json | 5 -- test/fixtures/godep-devel-go/main.go | 8 --- .../vendor/vendor.json | 7 ++- .../govendor-basic/vendor/vendor.json | 7 ++- test/fixtures/govendor-cmd/vendor/vendor.json | 7 +-- .../govendor-excluded/vendor/vendor.json | 5 +- .../vendor/vendor.json | 3 +- .../govendor-with-tests/vendor/vendor.json | 7 ++- test/run.sh | 51 +++++++++++-------- 18 files changed, 66 insertions(+), 49 deletions(-) delete mode 100644 test/fixtures/godep-devel-go/Godeps/Godeps.json delete mode 100644 test/fixtures/godep-devel-go/main.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a9c4930..a7242f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +* Defaults to go1.20.14 when Go version is not specified +* Defaults to go1.20.14 when bootstrapping Go development releases ## [v187] - 2024-02-08 diff --git a/data.json b/data.json index 4818f88f..e0109174 100644 --- a/data.json +++ b/data.json @@ -1,6 +1,6 @@ { "Go": { - "DefaultVersion": "go1.12.17", + "DefaultVersion": "go1.20.14", "VersionExpansion": { "go1.22": "go1.22.0", "go1.21": "go1.21.7", diff --git a/test/fixtures/dep-golang-migrate/Gopkg.toml b/test/fixtures/dep-golang-migrate/Gopkg.toml index 722e57f5..c96c4da8 100644 --- a/test/fixtures/dep-golang-migrate/Gopkg.toml +++ b/test/fixtures/dep-golang-migrate/Gopkg.toml @@ -1,4 +1,5 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" additional-tools = ["github.com/golang-migrate/migrate"] diff --git a/test/fixtures/dep-install-multi/Gopkg.toml b/test/fixtures/dep-install-multi/Gopkg.toml index 1e1a4090..12e8b466 100644 --- a/test/fixtures/dep-install-multi/Gopkg.toml +++ b/test/fixtures/dep-install-multi/Gopkg.toml @@ -1,4 +1,5 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" install = ["./a","./b"] diff --git a/test/fixtures/dep-mattes-migrate/Gopkg.toml b/test/fixtures/dep-mattes-migrate/Gopkg.toml index fa6bbfbe..49322245 100644 --- a/test/fixtures/dep-mattes-migrate/Gopkg.toml +++ b/test/fixtures/dep-mattes-migrate/Gopkg.toml @@ -1,4 +1,5 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" additional-tools = ["github.com/mattes/migrate"] diff --git a/test/fixtures/dep-no-deps/Gopkg.toml b/test/fixtures/dep-no-deps/Gopkg.toml index d1e2861d..ca2edab4 100644 --- a/test/fixtures/dep-no-deps/Gopkg.toml +++ b/test/fixtures/dep-no-deps/Gopkg.toml @@ -1,4 +1,5 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" # Gopkg.toml example diff --git a/test/fixtures/dep-no-ensure/Gopkg.toml b/test/fixtures/dep-no-ensure/Gopkg.toml index 8639b422..58399087 100644 --- a/test/fixtures/dep-no-ensure/Gopkg.toml +++ b/test/fixtures/dep-no-ensure/Gopkg.toml @@ -1,4 +1,5 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" ensure = "false" diff --git a/test/fixtures/dep-with-dep-pruned/Gopkg.toml b/test/fixtures/dep-with-dep-pruned/Gopkg.toml index be05076b..ca2edab4 100644 --- a/test/fixtures/dep-with-dep-pruned/Gopkg.toml +++ b/test/fixtures/dep-with-dep-pruned/Gopkg.toml @@ -1,6 +1,7 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" - + # Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md diff --git a/test/fixtures/dep-with-dep/Gopkg.toml b/test/fixtures/dep-with-dep/Gopkg.toml index be05076b..ca2edab4 100644 --- a/test/fixtures/dep-with-dep/Gopkg.toml +++ b/test/fixtures/dep-with-dep/Gopkg.toml @@ -1,6 +1,7 @@ [metadata.heroku] + go-version = "go1.12" root-package = "github.com/heroku/fixture" - + # Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md diff --git a/test/fixtures/godep-devel-go/Godeps/Godeps.json b/test/fixtures/godep-devel-go/Godeps/Godeps.json deleted file mode 100644 index 7e8af9ca..00000000 --- a/test/fixtures/godep-devel-go/Godeps/Godeps.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "GoVersion": "devel-15f7a66", - "ImportPath": "github.com/heroku/fixture", - "Deps": [] -} \ No newline at end of file diff --git a/test/fixtures/godep-devel-go/main.go b/test/fixtures/godep-devel-go/main.go deleted file mode 100644 index dc588e14..00000000 --- a/test/fixtures/godep-devel-go/main.go +++ /dev/null @@ -1,8 +0,0 @@ -package main - -import "fmt" -import "runtime" - -func main() { - fmt.Println(runtime.Version()) -} diff --git a/test/fixtures/govendor-basic-wo-procfile/vendor/vendor.json b/test/fixtures/govendor-basic-wo-procfile/vendor/vendor.json index c34a554c..f1a11f29 100644 --- a/test/fixtures/govendor-basic-wo-procfile/vendor/vendor.json +++ b/test/fixtures/govendor-basic-wo-procfile/vendor/vendor.json @@ -3,5 +3,8 @@ "comment": "", "ignore": "test", "package": [ - ] -} \ No newline at end of file + ], + "heroku": { + "goVersion": "go1.12" + } +} diff --git a/test/fixtures/govendor-basic/vendor/vendor.json b/test/fixtures/govendor-basic/vendor/vendor.json index c34a554c..f1a11f29 100644 --- a/test/fixtures/govendor-basic/vendor/vendor.json +++ b/test/fixtures/govendor-basic/vendor/vendor.json @@ -3,5 +3,8 @@ "comment": "", "ignore": "test", "package": [ - ] -} \ No newline at end of file + ], + "heroku": { + "goVersion": "go1.12" + } +} diff --git a/test/fixtures/govendor-cmd/vendor/vendor.json b/test/fixtures/govendor-cmd/vendor/vendor.json index 5ac1d7b6..dedb2e96 100644 --- a/test/fixtures/govendor-cmd/vendor/vendor.json +++ b/test/fixtures/govendor-cmd/vendor/vendor.json @@ -3,8 +3,9 @@ "comment": "", "ignore": "test", "heroku": { - "install":["./..."] + "install":["./..."], + "goVersion": "go1.12" }, "package": [ - ] -} \ No newline at end of file + ] +} diff --git a/test/fixtures/govendor-excluded/vendor/vendor.json b/test/fixtures/govendor-excluded/vendor/vendor.json index 093b1174..027d3459 100644 --- a/test/fixtures/govendor-excluded/vendor/vendor.json +++ b/test/fixtures/govendor-excluded/vendor/vendor.json @@ -9,5 +9,8 @@ "revisionTime": "2015-01-10T00:16:55Z" } ], - "rootPath": "github.com/heroku/fixture" + "rootPath": "github.com/heroku/fixture", + "heroku": { + "goVersion": "go1.12" + } } diff --git a/test/fixtures/govendor-mattes-migrate/vendor/vendor.json b/test/fixtures/govendor-mattes-migrate/vendor/vendor.json index b57de25b..28814aca 100644 --- a/test/fixtures/govendor-mattes-migrate/vendor/vendor.json +++ b/test/fixtures/govendor-mattes-migrate/vendor/vendor.json @@ -3,7 +3,8 @@ "ignore": "test", "heroku": { "install":["."], - "additionalTools":["github.com/mattes/migrate"] + "additionalTools":["github.com/mattes/migrate"], + "goVersion": "go1.12" }, "package": [], "rootPath": "github.com/heroku/fixture" diff --git a/test/fixtures/govendor-with-tests/vendor/vendor.json b/test/fixtures/govendor-with-tests/vendor/vendor.json index c34a554c..f1a11f29 100644 --- a/test/fixtures/govendor-with-tests/vendor/vendor.json +++ b/test/fixtures/govendor-with-tests/vendor/vendor.json @@ -3,5 +3,8 @@ "comment": "", "ignore": "test", "package": [ - ] -} \ No newline at end of file + ], + "heroku": { + "goVersion": "go1.12" + } +} diff --git a/test/run.sh b/test/run.sh index ef771412..d68150a7 100755 --- a/test/run.sh +++ b/test/run.sh @@ -8,7 +8,7 @@ testModWithBZRDep() { compile assertModulesBoilerplateCaptured - assertGoInstallCaptured + assertGoInstallCaptured "go1.12.17" assertGoInstallOnlyFixturePackageCaptured assertCapturedExitSuccess @@ -74,7 +74,7 @@ testModProcfileCreation() { compile assertModulesBoilerplateCaptured - assertGoInstallCaptured + assertGoInstallCaptured "go1.12.17" assertCaptured "Running: go install -v -tags heroku github.com/heroku/fixture/cmd/web github.com/heroku/fixture/cmd/other" @@ -128,7 +128,7 @@ testModWithQuotesModule() { compile assertModulesBoilerplateCaptured - assertGoInstallCaptured + assertGoInstallCaptured "go1.12.17" assertGoInstallOnlyFixturePackageCaptured assertCapturedSuccess @@ -162,7 +162,7 @@ testModcmdDetection() { compile assertModulesBoilerplateCaptured - assertGoInstallCaptured + assertGoInstallCaptured "go1.12.17" assertCaptured "Detected the following main packages to install: github.com/heroku/fixture/cmd/fixture github.com/heroku/fixture/cmd/other" @@ -706,6 +706,7 @@ testTestPackGlideWithTestsSkipBenchmark() { fixture "glide-with-tests" env "GO_TEST_SKIP_BENCHMARK" "nope" + env "GOVERSION" "go1.12" dotest assertCapturedSuccess @@ -734,6 +735,7 @@ testTestPackGBWithTestsSkipBenchmark() { fixture "gb-with-tests" env "GO_TEST_SKIP_BENCHMARK" "nope" + env "GOVERSION" "go1.12" dotest assertCapturedSuccess @@ -759,6 +761,8 @@ testTestPackGovendorWithTests() { testTestPackGlideWithTests() { fixture "glide-with-tests" + env "GOVERSION" "go1.12" + dotest assertCapturedSuccess assertCaptured "RUN TestHello" @@ -771,6 +775,8 @@ testTestPackGlideWithTests() { testTestPackGodepWithTests() { fixture "godep-with-tests" + env "GOVERSION" "go1.12" + dotest assertCapturedSuccess assertCaptured "RUN TestHello" @@ -783,6 +789,8 @@ testTestPackGodepWithTests() { testTestPackGBWithTests() { fixture "gb-with-tests" + env "GOVERSION" "go1.12" + dotest assertCapturedSuccess assertCaptured "RUN TestHello" @@ -795,6 +803,8 @@ testTestPackGBWithTests() { testGlideWithHgDep() { fixture "glide-with-hg-dep" + env "GOVERSION" "go1.12" + assertDetected compile @@ -895,6 +905,7 @@ testGlideMassageVendor() { fixture "glide-massage-vendor" env "GO_INSTALL_PACKAGE_SPEC" ". github.com/mattes/migrate" + env "GOVERSION" "go1.12" assertDetected @@ -935,6 +946,8 @@ testGlideMassageVendor() { testGlideWithOutDeps() { fixture "glide-wo-deps" + env "GOVERSION" "go1.12" + assertDetected compile @@ -950,6 +963,8 @@ testGlideWithOutDeps() { testGlideWithDeps() { fixture "glide-with-deps" + env "GOVERSION" "go1.12" + assertDetected compile @@ -965,6 +980,8 @@ testGlideWithDeps() { testGlideBasic() { fixture "glide-basic" + env "GOVERSION" "go1.12" + assertDetected compile @@ -981,6 +998,7 @@ testGlideBasicWithTools() { fixture "glide-basic" env "GO_INSTALL_TOOLS_IN_IMAGE" "true" + env "GOVERSION" "go1.12" assertDetected @@ -999,6 +1017,7 @@ testGlideBasicInGOPATH() { fixture "glide-basic" env "GO_SETUP_GOPATH_IN_IMAGE" "true" + env "GOVERSION" "go1.12" assertDetected @@ -1164,24 +1183,6 @@ testGodepCGOBasic() { assertCompiledBinaryExists } -testGodepDevelGo() { - fixture "godep-devel-go" - - assertDetected - - compile - assertCaptured "You are using a development build of Go." - assertCaptured "Installing bootstrap go" - assertCaptured "Downloading development Go version devel-15f7a66" - assertCaptured "Compiling development Go version devel-15f7a66" - assertCaptured "Installed Go for linux/amd64" - assertCaptured "go version devel +15f7a66" - assertCapturedSuccess - assertCompiledBinaryExists - assertCompiledBinaryOutputs "fixture" "devel +15fa66" - #assertTrue "Binary has the right value" '[[ "$(${BUILD_DIR}/bin/fixture)" = *"devel +15f7a66"* ]]' -} - testGodepBinFile() { fixture "godep-bin-file" @@ -1221,6 +1222,8 @@ testGodepMalformed() { testGBVendor() { fixture "gb-vendor" + env "GOVERSION" "go1.12" + assertDetected compile @@ -1236,6 +1239,8 @@ testGBVendor() { testGBBasic() { fixture "gb-basic" + env "GOVERSION" "go1.12" + assertDetected compile @@ -1252,10 +1257,12 @@ testGBBasicWithTools() { fixture "gb-basic" env "GO_INSTALL_TOOLS_IN_IMAGE" "true" + env "GOVERSION" "go1.12" assertDetected compile + assertCaptured "Installing go" assertCaptured "Installing GB" assertCaptured "Running: gb build -tags heroku"