Skip to content

Commit

Permalink
Add v1.0.2 runtime apis
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanchajanya committed Oct 20, 2023
1 parent 25879f6 commit a5b8819
Show file tree
Hide file tree
Showing 55 changed files with 9,791 additions and 3,708 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ build-compatibility-test-plugins: ## Builds all runtime compatibility test plugi
cd ./test/compatibility/testplugins/runtime-test-plugin-v0_25_4 && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin
cd ./test/compatibility/testplugins/runtime-test-plugin-v0_28_0 && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin
cd ./test/compatibility/testplugins/runtime-test-plugin-v0_90 && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin
cd ./test/compatibility/testplugins/runtime-test-plugin-v1_0_2 && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin
cd ./test/compatibility/testplugins/runtime-test-plugin-latest && ${GO} mod tidy && GOOS=$(OS) GOARCH=$(ARCH) ${GO} build -o ../bin

# The below command runs the compatibility tests using ginkgo and filter the logs as per regex and exit code with '0' representing success and non-zero values indicating test failures
Expand Down
3 changes: 1 addition & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GOIMPORTS_VERSION=0.1.12
VALE_VERSION=2.20.1
GOLANGCI_LINT_VERSION=1.51.0
MISSPELL_VERSION=0.3.4
GINKGO_VERSION=2.9.0
GINKGO_VERSION=2.9.2

# Host information.
HOST_OS=$(shell go env GOOS)
Expand Down
2 changes: 2 additions & 0 deletions test/compatibility/core/api_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const (
Version0254 RuntimeVersion = "v0.25.4"
Version0280 RuntimeVersion = "v0.28.0"
Version090 RuntimeVersion = "v0.90.0"
Version102 RuntimeVersion = "v1.0.2"
VersionLatest RuntimeVersion = "latest"
)

Expand All @@ -106,6 +107,7 @@ var SupportedRuntimeVersions = []RuntimeVersion{
Version0254,
Version0280,
Version090,
Version102,
VersionLatest,
}

Expand Down
3 changes: 3 additions & 0 deletions test/compatibility/core/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
pluginV0254 = "runtime-test-plugin-v0_25_4"
pluginV0280 = "runtime-test-plugin-v0_28_0"
pluginV090 = "runtime-test-plugin-v0_90"
pluginV102 = "runtime-test-plugin-v1_0_2"
pluginLatest = "runtime-test-plugin-latest"
)

Expand Down Expand Up @@ -55,6 +56,8 @@ func makeRuntimeTestPluginCommand(version RuntimeVersion) string {
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV0280)
case Version090:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV090)
case Version102:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginV102)
case VersionLatest:
return fmt.Sprintf("%v/%v test", pluginRoot, pluginLatest)
default:
Expand Down
13 changes: 13 additions & 0 deletions test/compatibility/core/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ func TestConstructTestPluginCmd(t *testing.T) {
pluginCmd: pluginLatest,
err: "",
},
{
version: Version102,
apis: []*API{
{
Name: SetContextAPI,
Version: Version102,
Arguments: map[APIArgumentType]interface{}{},
Output: nil,
},
},
pluginCmd: pluginV102,
err: "",
},
{
version: Version090,
apis: []*API{
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) {
version101 := &RuntimeAPIVersion{RuntimeVersion: "v1.0.1"}
actual, err := version101.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 @@ -133,7 +133,7 @@ func DefaultCLIDiscoverySourcePerVersion(version core.RuntimeVersion) *CfgCLIDis
WithOCIDiscoveryOpts(oci),
WithContextType(types.CtxTypeTMC),
)
case core.VersionLatest, core.Version090, core.Version0280:
case core.VersionLatest, core.Version102, core.Version090, core.Version0280:
return NewCfgCLIDiscoverySourcesArgs(
WithOCIDiscoveryOpts(oci),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (opts *SetCLIDiscoverySourceInputOptions) Validate() (bool, error) {
}

switch opts.RuntimeVersion {
case core.VersionLatest, core.Version090, core.Version0280, core.Version0116:
case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0116:
err = opts.PluginDiscoveryOpts.ValidPluginDiscovery()
if err != nil {
return false, err
Expand Down Expand Up @@ -65,7 +65,7 @@ func (opts *GetCLIDiscoverySourceOutputOptions) Validate() (bool, error) {
}

switch opts.RuntimeVersion {
case core.VersionLatest, core.Version090, core.Version0280, core.Version0116:
case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0116:
err = opts.PluginDiscoveryOpts.ValidPluginDiscovery()
if err != nil {
return false, err
Expand Down
Loading

0 comments on commit a5b8819

Please sign in to comment.