test(tools): add more version checks

https://github.com/khuedoan/homelab/pull/88
This commit is contained in:
Khue Doan 2022-10-22 12:18:58 +07:00 committed by GitHub
parent 4bf068b7f6
commit ea4d9b1ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -87,3 +87,6 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.0.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
// TODO https://github.com/gruntwork-io/terratest/pull/1182
replace github.com/gruntwork-io/terratest v0.40.18 => github.com/khuedoan/terratest v0.0.0-20220921151310-016fe8e1536b

View File

@ -214,8 +214,6 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro=
github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78=
github.com/gruntwork-io/terratest v0.40.18 h1:xuFaHOf/7kwc5cQN+6FfbmKglneBKesZxPHgISgkUlc=
github.com/gruntwork-io/terratest v0.40.18/go.mod h1:JGeIGgLbxbG9/Oqm06z6YXVr76CfomdmLkV564qov+8=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
@ -255,6 +253,8 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/khuedoan/terratest v0.0.0-20220921151310-016fe8e1536b h1:lXY6P/dU40e2GjapTxZrzt6/IZxfsdifXzJyFwGJbFM=
github.com/khuedoan/terratest v0.0.0-20220921151310-016fe8e1536b/go.mod h1:JGeIGgLbxbG9/Oqm06z6YXVr76CfomdmLkV564qov+8=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=

View File

@ -15,18 +15,18 @@ func TestToolsVersions(t *testing.T) {
var tools = []struct {
binaryPath string
versionArg string
versionConstraint string
}{
{"ansible", ">= 2.12.6, < 3.0.0"},
{"docker", ">= 20.10.17, < 21.0.0"},
{"git", ">= 2.37.1, < 3.0.0"},
// TODO add more version checks
// {"go", ">= 2.37.1, < 3.0.0"},
// {"helm", ">= 2.37.1, < 3.0.0"},
// {"kubectl", ">= 2.37.1, < 3.0.0"},
// {"kustomize", ">= 2.37.1, < 3.0.0"},
{"pre-commit", ">= 2.20.0, < 3.0.0"},
{"terraform", ">= 1.3.1, < 1.4.0"},
{"ansible", "--version", ">= 2.12.6, < 3.0.0"},
{"docker", "--version", ">= 20.10.17, < 21.0.0"},
{"git", "--version", ">= 2.37.1, < 3.0.0"},
{"go", "version", ">= 1.18.5, < 1.19.0"},
{"helm", "version", ">= 3.9.4, < 4.0.0"},
// {"kubectl", "version", ">= 1.23.11, < 1.25.0"}, // https://kubernetes.io/releases/version-skew-policy/#kubectl
{"kustomize", "version", ">= 4.5.4, < 5.0.0"},
{"pre-commit", "--version", ">= 2.20.0, < 3.0.0"},
{"terraform", "--version", ">= 1.3.1, < 1.4.0"},
}
for _, tool := range tools {
@ -36,6 +36,7 @@ func TestToolsVersions(t *testing.T) {
params := version_checker.CheckVersionParams{
BinaryPath: tool.binaryPath,
VersionConstraint: tool.versionConstraint,
VersionArg: tool.versionArg,
WorkingDir: ".",
}