Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanchajanya committed Oct 11, 2023
1 parent 05e8385 commit 904fcae
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 104 deletions.
4 changes: 2 additions & 2 deletions test/compatibility/core/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
pluginV0254 = "runtime-test-plugin-v0_25_4"
pluginV0280 = "runtime-test-plugin-v0_28_0"
pluginV090 = "runtime-test-plugin-v0_90"
pluginV101 = "runtime-test-plugin-v1_0_2"
pluginV102 = "runtime-test-plugin-v1_0_2"
pluginLatest = "runtime-test-plugin-latest"
)

Expand Down Expand Up @@ -57,7 +57,7 @@ func makeRuntimeTestPluginCommand(version RuntimeVersion) string {
case Version090:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV090)
case Version102:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV101)
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV102)
case VersionLatest:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginLatest)
default:
Expand Down
2 changes: 1 addition & 1 deletion test/compatibility/core/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestConstructTestPluginCmd(t *testing.T) {
Output: nil,
},
},
pluginCmd: pluginV101,
pluginCmd: pluginV102,
err: "",
},
{
Expand Down
6 changes: 3 additions & 3 deletions test/compatibility/core/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func TestValidRuntimeVersionV090(t *testing.T) {
}

func TestInvalidRuntimeVersion(t *testing.T) {
Version102 := &RuntimeAPIVersion{RuntimeVersion: "v1.0.1"}
actual, err := Version102.Validate()
assert.Equal(t, "runtime version v1.0.1 is not supported", err.Error())
Version103 := &RuntimeAPIVersion{RuntimeVersion: "v1.0.3"}
actual, err := Version103.Validate()
assert.Equal(t, "runtime version v1.0.3 is not supported", err.Error())
assert.Equal(t, false, actual)
}
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ var _ = ginkgo.Describe("Cross-version Context APIs compatibility tests", func()
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280)))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254)))

testCase.Add(context.GetCurrentContextCommand(context.WithError()))
testCase.Add(context.GetCurrentContextCommand())
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version102)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280)))
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var _ = ginkgo.Describe("Cross-version Legacy Client Config APIs compatibility t
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280)))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254)))

testCase.Add(context.GetCurrentContextCommand(context.WithError()))
testCase.Add(context.GetCurrentContextCommand())
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version102)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280)))
Expand Down Expand Up @@ -276,32 +276,32 @@ var _ = ginkgo.Describe("Cross-version Legacy Client Config APIs compatibility t
testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254)))
testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116)))

testCase.Add(context.GetContextCommand())
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102)))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280)))
testCase.Add(context.GetContextCommand(context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254)))

testCase.Add(context.GetCurrentContextCommand())
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version102)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280)))
testCase.Add(context.GetCurrentContextCommand(context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version102), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254)))

testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090)))
testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))
testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))

testCase.Add(context.GetContextCommand(context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithError()))
testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254)))

testCase.Add(context.GetCurrentContextCommand(context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version102), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithError()))
testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254)))

executer.Execute(testCase)
})
Expand Down
14 changes: 7 additions & 7 deletions test/compatibility/framework/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.18
replace github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core => ../core

require (
github.com/onsi/ginkgo/v2 v2.9.0
github.com/onsi/gomega v1.27.2
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.6
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.1
github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core v0.0.0-00010101000000-000000000000
Expand All @@ -17,7 +17,7 @@ require (
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
Expand All @@ -26,10 +26,10 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
Expand Down
33 changes: 16 additions & 17 deletions test/compatibility/framework/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand All @@ -31,10 +31,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/onsi/ginkgo/v2 v2.9.0 h1:Tugw2BKlNHTMfG+CheOITkYvk4LAh6MFOvikhGVnhE8=
github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk=
github.com/onsi/gomega v1.27.2 h1:SKU0CXeKE/WVgIV1T61kSa3+IRE8Ekrv9rdXDwwTqnY=
github.com/onsi/gomega v1.27.2/go.mod h1:5mR3phAHpkAVIDkHEUBY6HGVsU+cpcEscrGPB4oPlZI=
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -44,7 +44,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
Expand All @@ -60,27 +60,27 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand All @@ -90,7 +90,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Expand Down

0 comments on commit 904fcae

Please sign in to comment.