Skip to content

Commit

Permalink
Use go1.20.14 for DefaultVersion (#540)
Browse files Browse the repository at this point in the history
* 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 <josh.lewis@salesforce.com>
  • Loading branch information
ashmckenzie and joshwlewis committed Feb 16, 2024
1 parent c372f82 commit dfecaac
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 49 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Go": {
"DefaultVersion": "go1.12.17",
"DefaultVersion": "go1.20.14",
"VersionExpansion": {
"go1.22": "go1.22.0",
"go1.21": "go1.21.7",
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dep-golang-migrate/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[metadata.heroku]
go-version = "go1.12"
root-package = "github.com/heroku/fixture"
additional-tools = ["github.com/golang-migrate/migrate"]

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dep-install-multi/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[metadata.heroku]
go-version = "go1.12"
root-package = "github.com/heroku/fixture"
install = ["./a","./b"]

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dep-mattes-migrate/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[metadata.heroku]
go-version = "go1.12"
root-package = "github.com/heroku/fixture"
additional-tools = ["github.com/mattes/migrate"]

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dep-no-deps/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[metadata.heroku]
go-version = "go1.12"
root-package = "github.com/heroku/fixture"

# Gopkg.toml example
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dep-no-ensure/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[metadata.heroku]
go-version = "go1.12"
root-package = "github.com/heroku/fixture"
ensure = "false"

Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/dep-with-dep-pruned/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/dep-with-dep/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 0 additions & 5 deletions test/fixtures/godep-devel-go/Godeps/Godeps.json

This file was deleted.

8 changes: 0 additions & 8 deletions test/fixtures/godep-devel-go/main.go

This file was deleted.

7 changes: 5 additions & 2 deletions test/fixtures/govendor-basic-wo-procfile/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"comment": "",
"ignore": "test",
"package": [
]
}
],
"heroku": {
"goVersion": "go1.12"
}
}
7 changes: 5 additions & 2 deletions test/fixtures/govendor-basic/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"comment": "",
"ignore": "test",
"package": [
]
}
],
"heroku": {
"goVersion": "go1.12"
}
}
7 changes: 4 additions & 3 deletions test/fixtures/govendor-cmd/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"comment": "",
"ignore": "test",
"heroku": {
"install":["./..."]
"install":["./..."],
"goVersion": "go1.12"
},
"package": [
]
}
]
}
5 changes: 4 additions & 1 deletion test/fixtures/govendor-excluded/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"revisionTime": "2015-01-10T00:16:55Z"
}
],
"rootPath": "github.com/heroku/fixture"
"rootPath": "github.com/heroku/fixture",
"heroku": {
"goVersion": "go1.12"
}
}
3 changes: 2 additions & 1 deletion test/fixtures/govendor-mattes-migrate/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions test/fixtures/govendor-with-tests/vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"comment": "",
"ignore": "test",
"package": [
]
}
],
"heroku": {
"goVersion": "go1.12"
}
}
51 changes: 29 additions & 22 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ testModWithBZRDep() {

compile
assertModulesBoilerplateCaptured
assertGoInstallCaptured
assertGoInstallCaptured "go1.12.17"
assertGoInstallOnlyFixturePackageCaptured

assertCapturedExitSuccess
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -128,7 +128,7 @@ testModWithQuotesModule() {

compile
assertModulesBoilerplateCaptured
assertGoInstallCaptured
assertGoInstallCaptured "go1.12.17"
assertGoInstallOnlyFixturePackageCaptured

assertCapturedSuccess
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -706,6 +706,7 @@ testTestPackGlideWithTestsSkipBenchmark() {
fixture "glide-with-tests"

env "GO_TEST_SKIP_BENCHMARK" "nope"
env "GOVERSION" "go1.12"

dotest
assertCapturedSuccess
Expand Down Expand Up @@ -734,6 +735,7 @@ testTestPackGBWithTestsSkipBenchmark() {
fixture "gb-with-tests"

env "GO_TEST_SKIP_BENCHMARK" "nope"
env "GOVERSION" "go1.12"

dotest
assertCapturedSuccess
Expand All @@ -759,6 +761,8 @@ testTestPackGovendorWithTests() {
testTestPackGlideWithTests() {
fixture "glide-with-tests"

env "GOVERSION" "go1.12"

dotest
assertCapturedSuccess
assertCaptured "RUN TestHello"
Expand All @@ -771,6 +775,8 @@ testTestPackGlideWithTests() {
testTestPackGodepWithTests() {
fixture "godep-with-tests"

env "GOVERSION" "go1.12"

dotest
assertCapturedSuccess
assertCaptured "RUN TestHello"
Expand All @@ -783,6 +789,8 @@ testTestPackGodepWithTests() {
testTestPackGBWithTests() {
fixture "gb-with-tests"

env "GOVERSION" "go1.12"

dotest
assertCapturedSuccess
assertCaptured "RUN TestHello"
Expand All @@ -795,6 +803,8 @@ testTestPackGBWithTests() {
testGlideWithHgDep() {
fixture "glide-with-hg-dep"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand Down Expand Up @@ -895,6 +905,7 @@ testGlideMassageVendor() {
fixture "glide-massage-vendor"

env "GO_INSTALL_PACKAGE_SPEC" ". github.com/mattes/migrate"
env "GOVERSION" "go1.12"

assertDetected

Expand Down Expand Up @@ -935,6 +946,8 @@ testGlideMassageVendor() {
testGlideWithOutDeps() {
fixture "glide-wo-deps"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand All @@ -950,6 +963,8 @@ testGlideWithOutDeps() {
testGlideWithDeps() {
fixture "glide-with-deps"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand All @@ -965,6 +980,8 @@ testGlideWithDeps() {
testGlideBasic() {
fixture "glide-basic"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand All @@ -981,6 +998,7 @@ testGlideBasicWithTools() {
fixture "glide-basic"

env "GO_INSTALL_TOOLS_IN_IMAGE" "true"
env "GOVERSION" "go1.12"

assertDetected

Expand All @@ -999,6 +1017,7 @@ testGlideBasicInGOPATH() {
fixture "glide-basic"

env "GO_SETUP_GOPATH_IN_IMAGE" "true"
env "GOVERSION" "go1.12"

assertDetected

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -1221,6 +1222,8 @@ testGodepMalformed() {
testGBVendor() {
fixture "gb-vendor"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand All @@ -1236,6 +1239,8 @@ testGBVendor() {
testGBBasic() {
fixture "gb-basic"

env "GOVERSION" "go1.12"

assertDetected

compile
Expand All @@ -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"
Expand Down

0 comments on commit dfecaac

Please sign in to comment.