From f535e7ff4bf050778e924892c8f0139d3b7291f0 Mon Sep 17 00:00:00 2001 From: Panchajanya Mysarla Date: Wed, 4 Oct 2023 09:37:55 -0500 Subject: [PATCH] Add v1.0.2 runtime apis --- Makefile | 1 + test/compatibility/core/api_constants.go | 2 + test/compatibility/core/helpers.go | 3 + test/compatibility/core/helpers_test.go | 13 + test/compatibility/core/validators_test.go | 6 +- .../cli_discoverysources_helpers.go | 2 +- .../cli_discoverysources_validators.go | 4 +- .../cli_discoverysources_test.go | 58 +- .../context/context_test.go | 1356 ++++++-- .../context/context_test_helpers.go | 853 ----- .../contextserver/context_and_server_test.go | 1016 ++---- .../envflags/envflags_test.go | 513 ++- .../featureflags/featureflags_test.go | 861 ++++- .../legacyclientconfig_test.go | 687 ++-- .../metadata/metadata_test.go | 506 +-- .../compatibilitytests/server/server_test.go | 2890 ++++++++++++++--- .../server/server_test_helpers.go | 847 ----- .../framework/context/context_helpers.go | 375 +++ .../framework/context/context_options.go | 36 + .../framework/context/context_validators.go | 12 +- .../framework/envflags/env_validators.go | 8 +- .../featureflags/feature_validators.go | 6 +- test/compatibility/framework/go.mod | 14 +- test/compatibility/framework/go.sum | 33 +- .../legacyclientconfig_options.go | 4 +- .../framework/metadata/metadata_validators.go | 20 +- .../framework/server/server_helpers.go | 311 ++ .../framework/server/server_validators.go | 2 +- .../runtime-test-plugin-v0_90/go.mod | 1 - .../runtime-test-plugin-v1_0_2/LICENSE | 0 .../runtime-test-plugin-v1_0_2/cmd/parser.go | 50 + .../cmd/parser_test.go | 94 + .../runtime-test-plugin-v1_0_2/cmd/root.go | 27 + .../runtime-test-plugin-v1_0_2/cmd/test.go | 50 + .../cmd/trigger_apis.go | 98 + .../trigger_cli_discovery_source_apis_test.go | 212 ++ .../cmd/trigger_cli_disocvery_source_apis.go | 105 + .../cmd/trigger_context_apis.go | 193 ++ .../cmd/trigger_context_apis_test.go | 348 ++ .../cmd/trigger_env_apis.go | 130 + .../cmd/trigger_env_apis_test.go | 161 + .../cmd/trigger_feature_apis.go | 129 + .../cmd/trigger_feature_apis_test.go | 137 + .../cmd/trigger_legacyclientconfig_apis.go | 67 + .../cmd/trigger_metadata_apis.go | 289 ++ .../cmd/trigger_metadata_apis_test.go | 314 ++ .../cmd/trigger_server_apis.go | 186 ++ .../cmd/trigger_server_apis_test.go | 366 +++ .../runtime-test-plugin-v1_0_2/go.mod | 25 + .../runtime-test-plugin-v1_0_2/go.sum | 37 + .../runtime-test-plugin-v1_0_2/go.work | 5 + .../runtime-test-plugin-v1_0_2/go.work.sum | 21 + .../runtime-test-plugin-v1_0_2/main.go | 13 + 53 files changed, 9789 insertions(+), 3708 deletions(-) delete mode 100644 test/compatibility/framework/compatibilitytests/context/context_test_helpers.go delete mode 100644 test/compatibility/framework/compatibilitytests/server/server_test_helpers.go create mode 100644 test/compatibility/framework/context/context_helpers.go create mode 100644 test/compatibility/framework/server/server_helpers.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/LICENSE create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/root.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_discovery_source_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_disocvery_source_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_legacyclientconfig_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis_test.go create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.mod create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.sum create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work.sum create mode 100644 test/compatibility/testplugins/runtime-test-plugin-v1_0_2/main.go diff --git a/Makefile b/Makefile index bdef0df84..12467f1c8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/test/compatibility/core/api_constants.go b/test/compatibility/core/api_constants.go index 0718960f2..d1e44c57d 100644 --- a/test/compatibility/core/api_constants.go +++ b/test/compatibility/core/api_constants.go @@ -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" ) @@ -106,6 +107,7 @@ var SupportedRuntimeVersions = []RuntimeVersion{ Version0254, Version0280, Version090, + Version102, VersionLatest, } diff --git a/test/compatibility/core/helpers.go b/test/compatibility/core/helpers.go index e0107a9bb..cbbd27704 100644 --- a/test/compatibility/core/helpers.go +++ b/test/compatibility/core/helpers.go @@ -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" ) @@ -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: diff --git a/test/compatibility/core/helpers_test.go b/test/compatibility/core/helpers_test.go index 5a4225240..38a25b91a 100644 --- a/test/compatibility/core/helpers_test.go +++ b/test/compatibility/core/helpers_test.go @@ -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{ diff --git a/test/compatibility/core/validators_test.go b/test/compatibility/core/validators_test.go index 33642b6d2..cc7df1ba8 100644 --- a/test/compatibility/core/validators_test.go +++ b/test/compatibility/core/validators_test.go @@ -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) } diff --git a/test/compatibility/framework/clidiscoverysources/cli_discoverysources_helpers.go b/test/compatibility/framework/clidiscoverysources/cli_discoverysources_helpers.go index 8ac042c3d..b85005977 100644 --- a/test/compatibility/framework/clidiscoverysources/cli_discoverysources_helpers.go +++ b/test/compatibility/framework/clidiscoverysources/cli_discoverysources_helpers.go @@ -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), ) diff --git a/test/compatibility/framework/clidiscoverysources/cli_discoverysources_validators.go b/test/compatibility/framework/clidiscoverysources/cli_discoverysources_validators.go index 73215f53c..8884beec3 100644 --- a/test/compatibility/framework/clidiscoverysources/cli_discoverysources_validators.go +++ b/test/compatibility/framework/clidiscoverysources/cli_discoverysources_validators.go @@ -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 @@ -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 diff --git a/test/compatibility/framework/compatibilitytests/clidiscoverysources/cli_discoverysources_test.go b/test/compatibility/framework/compatibilitytests/clidiscoverysources/cli_discoverysources_test.go index cfea1da81..8687dbfa5 100644 --- a/test/compatibility/framework/compatibilitytests/clidiscoverysources/cli_discoverysources_test.go +++ b/test/compatibility/framework/compatibilitytests/clidiscoverysources/cli_discoverysources_test.go @@ -29,7 +29,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T }) - ginkgo.Context("Run SetCLIDiscoverySource, GetCLIDiscoverySource, GetClientConfig, DeleteCLIDiscoverySource on all supported Runtime library versions latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6", func() { + ginkgo.Context("Run SetCLIDiscoverySource, GetCLIDiscoverySource, GetClientConfig, DeleteCLIDiscoverySource on all supported Runtime library versions latest, v1.0.2, v0.90.0, v0.28.0, v0.25.4, v0.11.6", func() { ginkgo.It("Run SetCLIDiscoverySource of Runtime latest then GetCLIDiscoverySource, GetClientConfig on all supported Runtime library versions and then DeleteCLIDiscoverySource of Runtime v0.28.0 then GetCLIDiscoverySource on all supported Runtime library versions", func() { // Add SetCLIDiscoverySource Commands of Runtime Latest version @@ -38,10 +38,14 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithStrictValidationStrategy())) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add GetClientConfig Commands for latest testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultCLIDiscoverySource(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version090))) // Add GetClientConfig Commands for v0.25.4 and v0.11.6 with no discovery sources testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254)) @@ -52,6 +56,41 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetCLIDiscoverySource of Runtime v1.0.2 then GetCLIDiscoverySource, GetClientConfig on all supported Runtime library versions and then DeleteCLIDiscoverySource of Runtime v0.28.0 then GetCLIDiscoverySource on all supported Runtime library versions", func() { + // Add SetCLIDiscoverySource Commands of Runtime Latest version + testCase := core.NewTestCase() + testCase.Add(clidiscoverysources.DefaultSetCLIDiscoverySourceCommand(core.Version102)) + + // Add GetCLIDiscoverySource Commands on all supported Runtime library versions + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + + // Add GetClientConfig Commands for latest + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultCLIDiscoverySource(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version090))) + + // Add GetClientConfig Commands for v0.25.4 and v0.11.6 with no discovery sources + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254)) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116)) + + // Add DeleteCLIDiscoverySource v0.28.0 Command + testCase.Add(clidiscoverysources.DefaultDeleteCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + + // Add GetCLIDiscoverySource Commands on all supported Runtime library versions + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Run all the commands @@ -65,11 +104,13 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithStrictValidationStrategy())) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithStrictValidationStrategy())) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithStrictValidationStrategy())) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add GetClientConfig Commands for latest and v0.90.0 testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultCLIDiscoverySource(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version102))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version090))) // Add GetClientConfig Commands for v0.25.4 and v0.11.6 with no discovery sources @@ -81,6 +122,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest)) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) @@ -117,16 +159,15 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithStrictValidationStrategy())) // Add GetClientConfig Commands for v0.28.0, v0.25.4, v0.11.6 testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultCLIDiscoverySource(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithCLIDiscoverySources(core.Version0254, []types.PluginDiscoveryOpts{ *defaultOCISource, *ociSource, }))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithCLIDiscoverySources(core.Version0116, []types.PluginDiscoveryOpts{ *defaultOCISourceWithoutContextType, *ociSource, }))) @@ -136,6 +177,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithStrictValidationStrategy())) @@ -145,7 +187,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T }) - ginkgo.Context("Run StoreClientConfig, GetClientConfig, GetCLIDiscoverySource, DeleteCLIDiscoverySource on all supported Runtime library versions latest, v0.90.0, v0.28.0, 0.25.4, 0.11.6", func() { + ginkgo.Context("Run StoreClientConfig, GetClientConfig, GetCLIDiscoverySource, DeleteCLIDiscoverySource on all supported Runtime library versions latest, v1.0.2, v0.90.0, v0.28.0, 0.25.4, 0.11.6", func() { ginkgo.It("Run StoreClientConfig of Runtime v0.28.0 then GetClientConfig, GetCLIDiscoverySource on all supported Runtime library versions and then DeleteCLIDiscoverySource of Runtime latest then GetCLIDiscoverySource on all supported Runtime library versions", func() { // Setup discovery sources @@ -188,6 +230,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add DeleteCLIDiscoverySource Command of Runtime latest @@ -195,6 +238,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) @@ -243,6 +287,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add DeleteCLIDiscoverySource Command of Runtime latest @@ -250,6 +295,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) @@ -298,6 +344,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add DeleteCLIDiscoverySource v0.28.0 Command @@ -305,6 +352,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) @@ -353,6 +401,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280)) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) // Add DeleteCLIDiscoverySource v0.28.0 Command @@ -360,6 +409,7 @@ var _ = ginkgo.Describe("Cross-version CLI Discovery Source APIs Compatibility T // Add GetCLIDiscoverySource Commands on all supported Runtime library versions testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.VersionLatest, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) + testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version102, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version090, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) testCase.Add(clidiscoverysources.DefaultGetCLIDiscoverySourceCommand(core.Version0280, clidiscoverysources.WithError(clidiscoverysources.CLIDiscoverySourceNotFound))) diff --git a/test/compatibility/framework/compatibilitytests/context/context_test.go b/test/compatibility/framework/compatibilitytests/context/context_test.go index 37363387c..c055f9aa0 100644 --- a/test/compatibility/framework/compatibilitytests/context/context_test.go +++ b/test/compatibility/framework/compatibilitytests/context/context_test.go @@ -6,28 +6,23 @@ package context_test import ( "github.com/onsi/ginkgo/v2" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/context" - - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/context" "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/executer" - - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" ) var _ = ginkgo.Describe("Cross-version Context APIs compatibility tests", func() { - // Description on the Tests ginkgo.GinkgoWriter.Println("GetContext, SetContext, DeleteContext, GetCurrentContext, SetCurrentContext, RemoveCurrentContext methods are tested for cross-version API compatibility with supported Runtime versions v0.25.4, v0.28.0, v0.90.0, latest") - // Setup Data - var contextTestHelper context.Helper ginkgo.BeforeEach(func() { // Setup mock temporary config files for testing _, cleanup := core.SetupTempCfgFiles() ginkgo.DeferCleanup(func() { cleanup() }) - contextTestHelper.SetUpDefaultData() }) ginkgo.Context("using single context object on supported Runtime API versions", func() { @@ -35,437 +30,1228 @@ var _ = ginkgo.Describe("Cross-version Context APIs compatibility tests", func() ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands for Runtime latest - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetClientConfig Commands on all supported runtime versions testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) - - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + 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())) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest testCase := core.NewTestCase() - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetClientConfig Commands on all supported runtime versions testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.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())) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add RemoveCurrentContext v0.90.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime090) + ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v1.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add DeleteContext v0.90.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime090) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.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())) - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest testCase := core.NewTestCase() - testCase.Add(contextTestHelper.SetContextCmdForRuntime090) - testCase.Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - // Add GetClientConfig Commands on all supported runtime versions + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + 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())) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) + ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.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())) - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest testCase := core.NewTestCase() - testCase.Add(contextTestHelper.SetContextCmdForRuntime090) - testCase.Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - // Add GetClientConfig Commands on all supported runtime versions + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatest) - - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatest) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand()) + testCase.Add(context.DeleteContextCommand()) + + 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.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())) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime v0.28.0 - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetClientConfig Commands on all supported runtime versions testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatest) - - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatest) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand()) + testCase.Add(context.DeleteContextCommand()) + + 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.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())) + executer.Execute(testCase) }) - ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { testCase := core.NewTestCase() - testCase.Add(contextTestHelper.SetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.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())) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatestWithError) + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.90 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatestWithError) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.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())) - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add DeleteContext v0.25.4 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0254) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.WithRuntimeVersion(core.Version0254), 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))) + testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithError())) + executer.Execute(testCase) }) - }) + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - ginkgo.Context("using multiple context objects on supported Runtime API versions", func() { + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext latest Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + 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(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.WithError())) + testCase.Add(context.DeleteContextCommand(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))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.90.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + 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))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) + + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add RemoveCurrentContext v0.90.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add DeleteContext v0.90.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime090) + 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))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + 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))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102), context.WithError())) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102), 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))) + + 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))) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetContextTwoCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.90 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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(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), context.WithError())) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090), context.WithError())) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + 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))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + 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))) - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatest) + executer.Execute(testCase) + }) - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatest) + }) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + ginkgo.Context("using multiple context objects on supported Runtime API versions", func() { - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand()) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand()) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand()) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand()) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand()) + testCase.Add(context.DeleteContextCommand()) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) + executer.Execute(testCase) + }) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand()) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Run all the commands executer.Execute(testCase) }) ginkgo.It("Run SetContext, SetCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext v0.90.0 Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetContextTwoCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) + testCase := core.NewTestCase() - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.WithRuntimeVersion(core.Version0254), context.WithError())) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254), context.WithError())) - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) + executer.Execute(testCase) + }) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand()) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext v0.25.4 Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetContextTwoCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280WithError) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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())) - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280WithError) + executer.Execute(testCase) + }) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextTwoCmdForRuntime090WithError).Add(contextTestHelper.GetContextTwoCmdForRuntime0280WithError).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.Version0280), context.WithError())) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version0280), 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))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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))) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetContext, SetCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetContextTwoCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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), 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))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + executer.Execute(testCase) + }) + + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext v1.0.2 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add DeleteContext v0.25.4 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.Version102), context.WithError())) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102), 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))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + executer.Execute(testCase) + }) + + ginkgo.It("Run SetContext, SetCurrentContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0 latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, v0.90.0, latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest,v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithError())) + testCase.Add(context.DeleteContextCommand(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))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo), context.WithError())) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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))) - // Run all the commands executer.Execute(testCase) }) diff --git a/test/compatibility/framework/compatibilitytests/context/context_test_helpers.go b/test/compatibility/framework/compatibilitytests/context/context_test_helpers.go deleted file mode 100644 index ee550357f..000000000 --- a/test/compatibility/framework/compatibilitytests/context/context_test_helpers.go +++ /dev/null @@ -1,853 +0,0 @@ -// Copyright 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -// Package context contains all the cross version api compatibility tests for context apis -package context - -import ( - "fmt" - - "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" - - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/context" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/types" -) - -// Helper struct provides input and output options and api commands to be used in test cases -type Helper struct { - // SetContext Input Options - SetContextInputOptionsForRuntime0254 *context.SetContextInputOptions - SetContextInputOptionsForRuntime0280 *context.SetContextInputOptions - SetContextInputOptionsForRuntime090 *context.SetContextInputOptions - SetContextInputOptionsForRuntimeLatest *context.SetContextInputOptions - SetContextTwoInputOptionsForRuntime0254 *context.SetContextInputOptions - SetContextTwoInputOptionsForRuntime0280 *context.SetContextInputOptions - SetContextTwoInputOptionsForRuntime090 *context.SetContextInputOptions - SetContextTwoInputOptionsForRuntimeLatest *context.SetContextInputOptions - - // SetCurrentContext Input Options - SetCurrentContextInputOptionsForRuntime0254 *context.SetCurrentContextInputOptions - SetCurrentContextInputOptionsForRuntime0280 *context.SetCurrentContextInputOptions - SetCurrentContextInputOptionsForRuntime090 *context.SetCurrentContextInputOptions - SetCurrentContextInputOptionsForRuntimeLatest *context.SetCurrentContextInputOptions - - // GetContext Input Options - GetContextInputOptionsForRuntimeLatest *context.GetContextInputOptions - GetContextInputOptionsForRuntime090 *context.GetContextInputOptions - GetContextInputOptionsForRuntime0280 *context.GetContextInputOptions - GetContextInputOptionsForRuntime0254 *context.GetContextInputOptions - GetContextTwoInputOptionsForRuntimeLatest *context.GetContextInputOptions - GetContextTwoInputOptionsForRuntime090 *context.GetContextInputOptions - GetContextTwoInputOptionsForRuntime0280 *context.GetContextInputOptions - GetContextTwoInputOptionsForRuntime0254 *context.GetContextInputOptions - - // GetContext Output Options - GetContextOutputOptionsForRuntime0254 *context.GetContextOutputOptions - GetContextOutputOptionsForRuntime0280 *context.GetContextOutputOptions - GetContextOutputOptionsForRuntime090 *context.GetContextOutputOptions - GetContextOutputOptionsForRuntimeLatest *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntime0254 *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntime0280 *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntime090 *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntimeLatest *context.GetContextOutputOptions - - // GetContext Output Options with expected error - GetContextOutputOptionsForRuntimeLatestWithError *context.GetContextOutputOptions - GetContextOutputOptionsForRuntime090WithError *context.GetContextOutputOptions - GetContextOutputOptionsForRuntime0280WithError *context.GetContextOutputOptions - GetContextOutputOptionsForRuntime0254WithError *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntimeLatestWithError *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntime090WithError *context.GetContextOutputOptions - GetContextTwoOutputOptionsForRuntime0280WithError *context.GetContextOutputOptions - - // GetCurrentContext Input Options - GetCurrentContextInputOptionsForRuntime0254 *context.GetCurrentContextInputOptions - GetCurrentContextInputOptionsForRuntime0280 *context.GetCurrentContextInputOptions - GetCurrentContextInputOptionsForRuntime090 *context.GetCurrentContextInputOptions - GetCurrentContextInputOptionsForRuntimeLatest *context.GetCurrentContextInputOptions - - // GetCurrentContext Output Options - GetCurrentContextOutputOptionsForRuntime0254 *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntime0280 *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntime090 *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntimeLatest *context.GetCurrentContextOutputOptions - - // GetCurrentContext Output Options with expected error - GetCurrentContextOutputOptionsForRuntimeLatestWithError *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntime090WithError *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntime0280WithError *context.GetCurrentContextOutputOptions - GetCurrentContextOutputOptionsForRuntime0254WithError *context.GetCurrentContextOutputOptions - - // DeleteContext Input Options - DeleteContextInputOptionsForRuntime0254 *context.DeleteContextInputOptions - DeleteContextInputOptionsForRuntime0280 *context.DeleteContextInputOptions - DeleteContextInputOptionsForRuntime090 *context.DeleteContextInputOptions - DeleteContextInputOptionsForRuntimeLatest *context.DeleteContextInputOptions - - // DeleteContext Output Options with expected error - DeleteContextOutputOptionsForRuntime0280WithError *context.DeleteContextOutputOptions - DeleteContextOutputOptionsForRuntime090WithError *context.DeleteContextOutputOptions - DeleteContextOutputOptionsForRuntimeLatestWithError *context.DeleteContextOutputOptions - - // RemoveCurrentContext Input Options - RemoveCurrentContextInputOptionsForRuntime0280 *context.RemoveCurrentContextInputOptions - RemoveCurrentContextInputOptionsForRuntime090 *context.RemoveCurrentContextInputOptions - RemoveCurrentContextInputOptionsForRuntimeLatest *context.RemoveCurrentContextInputOptions - - // RemoveCurrentContext Output Options with expected error - RemoveCurrentContextOutputOptionsForRuntimeLatestWithError *context.RemoveCurrentContextOutputOptions - RemoveCurrentContextOutputOptionsForRuntime090WithError *context.RemoveCurrentContextOutputOptions - RemoveCurrentContextOutputOptionsForRuntime0280WithError *context.RemoveCurrentContextOutputOptions - - // Context API Commands - // SetContext API Commands - SetContextCmdForRuntimeLatest *core.Command - SetContextCmdForRuntime090 *core.Command - SetContextCmdForRuntime0280 *core.Command - SetContextCmdForRuntime0254 *core.Command - - SetContextTwoCmdForRuntimeLatest *core.Command - SetContextTwoCmdForRuntime090 *core.Command - SetContextTwoCmdForRuntime0280 *core.Command - SetContextTwoCmdForRuntime0254 *core.Command - - // SetCurrentContext API Commands - SetCurrentContextCmdForRuntime0254 *core.Command - SetCurrentContextCmdForRuntime0280 *core.Command - SetCurrentContextCmdForRuntime090 *core.Command - SetCurrentContextCmdForRuntimeLatest *core.Command - - // GetContext API Commands - GetContextCmdForRuntimeLatest *core.Command - GetContextCmdForRuntime090 *core.Command - GetContextCmdForRuntime0280 *core.Command - GetContextCmdForRuntime0254 *core.Command - - GetContextTwoCmdForRuntimeLatest *core.Command - GetContextTwoCmdForRuntime090 *core.Command - GetContextTwoCmdForRuntime0280 *core.Command - GetContextTwoCmdForRuntime0254 *core.Command - - GetContextCmdForRuntimeLatestWithError *core.Command - GetContextCmdForRuntime090WithError *core.Command - GetContextCmdForRuntime0280WithError *core.Command - GetContextCmdForRuntime0254WithError *core.Command - - GetContextTwoCmdForRuntimeLatestWithError *core.Command - GetContextTwoCmdForRuntime090WithError *core.Command - GetContextTwoCmdForRuntime0280WithError *core.Command - - // GetCurrentContext API Commands - GetCurrentContextCmdForRuntimeLatest *core.Command - GetCurrentContextCmdForRuntime090 *core.Command - GetCurrentContextCmdForRuntime0280 *core.Command - GetCurrentContextCmdForRuntime0254 *core.Command - - GetCurrentContextCmdForRuntimeLatestWithError *core.Command - GetCurrentContextCmdForRuntime090WithError *core.Command - GetCurrentContextCmdForRuntime0280WithError *core.Command - GetCurrentContextCmdForRuntime0254WithError *core.Command - - // DeleteContext API Commands - DeleteContextCmdForRuntime0280 *core.Command - DeleteContextCmdForRuntime0254 *core.Command - DeleteContextCmdForRuntime090 *core.Command - DeleteContextCmdForRuntimeLatest *core.Command - - DeleteContextCmdForRuntime0280WithError *core.Command - DeleteContextCmdForRuntimeLatestWithError *core.Command - DeleteContextCmdForRuntime090WithError *core.Command - - // RemoveCurrentContext API Commands - RemoveCurrentContextCmdForRuntime0280 *core.Command - RemoveCurrentContextCmdForRuntimeLatest *core.Command - RemoveCurrentContextCmdForRuntime090 *core.Command - - RemoveCurrentContextCmdForRuntimeLatestWithError *core.Command - RemoveCurrentContextCmdForRuntime090WithError *core.Command - RemoveCurrentContextCmdForRuntime0280WithError *core.Command -} - -// SetUpDefaultData sets up the Helper struct with default input/output options and api commands -func (b *Helper) SetUpDefaultData() { - b.SetupSetContextTestInputAndOutputOptions() - b.CreateSetContextAPICommands() - - b.SetupSetCurrentContextTestInputAndOutputOptions() - b.CreateSetCurrentContextAPICommands() - - b.SetupGetCurrentContextTestInputAndOutputOptions() - b.CreateGetCurrentContextAPICommands() - - b.SetupGetContextTestInputAndOutputOptions() - b.CreateGetContextAPICommands() - - b.SetupDeleteContextTestInputAndOutputOptions() - b.CreateDeleteContextAPICommands() - - b.SetupRemoveCurrentContextTestInputAndOutputOptions() - b.CreateRemoveCurrentContextAPICommands() -} - -// SetupRemoveCurrentContextTestInputAndOutputOptions sets input and output options for RemoveCurrentContext API -func (b *Helper) SetupRemoveCurrentContextTestInputAndOutputOptions() { - // Input and Output Options for RemoveCurrentContext - ginkgo.By("Setup Input and Output Options for RemoveCurrentContext") - - b.RemoveCurrentContextInputOptionsForRuntime0280 = DefaultRemoveCurrentContextInputOptions(core.Version0280) - b.RemoveCurrentContextInputOptionsForRuntime090 = DefaultRemoveCurrentContextInputOptions(core.Version090) - b.RemoveCurrentContextInputOptionsForRuntimeLatest = DefaultRemoveCurrentContextInputOptions(core.VersionLatest) - - b.RemoveCurrentContextOutputOptionsForRuntimeLatestWithError = DefaultRemoveCurrentContextOutputOptionsWithError(core.VersionLatest) - b.RemoveCurrentContextOutputOptionsForRuntime090WithError = DefaultRemoveCurrentContextOutputOptionsWithError(core.Version090) - b.RemoveCurrentContextOutputOptionsForRuntime0280WithError = DefaultRemoveCurrentContextOutputOptionsWithError(core.Version0280) -} - -// CreateRemoveCurrentContextAPICommands sets api commands for RemoveCurrentContext API -func (b *Helper) CreateRemoveCurrentContextAPICommands() { - // Create RemoveCurrentContext Commands with input and output options - ginkgo.By("Create RemoveCurrentContext API Commands") - - removeCurrentContextCmdForRuntime0280, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntime0280 = removeCurrentContextCmdForRuntime0280 - - removeCurrentContextCmdForRuntime090, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntime090 = removeCurrentContextCmdForRuntime090 - - removeCurrentContextCmdForRuntimeLatest, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntimeLatest = removeCurrentContextCmdForRuntimeLatest - - removeCurrentContextCmdForRuntimeLatestWithError, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntimeLatest, b.RemoveCurrentContextOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntimeLatestWithError = removeCurrentContextCmdForRuntimeLatestWithError - - removeCurrentContextCmdForRuntime090WithError, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntime090, b.RemoveCurrentContextOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntime090WithError = removeCurrentContextCmdForRuntime090WithError - - removeCurrentContextCmdForRuntime0280WithError, err := context.NewRemoveCurrentContextCommand(b.RemoveCurrentContextInputOptionsForRuntime0280, b.RemoveCurrentContextOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentContextCmdForRuntime0280WithError = removeCurrentContextCmdForRuntime0280WithError -} - -// SetupDeleteContextTestInputAndOutputOptions sets input and output options for DeleteContext API -func (b *Helper) SetupDeleteContextTestInputAndOutputOptions() { - // Input and Output Options for DeleteContext - ginkgo.By("Setup Input and Output Options for DeleteContext") - - b.DeleteContextInputOptionsForRuntime0280 = DefaultDeleteContextInputOptions(core.Version0280, common.CompatibilityTestOne) - b.DeleteContextInputOptionsForRuntime0254 = DefaultDeleteContextInputOptions(core.Version0254, common.CompatibilityTestOne) - b.DeleteContextInputOptionsForRuntime090 = DefaultDeleteContextInputOptions(core.Version090, common.CompatibilityTestOne) - b.DeleteContextInputOptionsForRuntimeLatest = DefaultDeleteContextInputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.DeleteContextOutputOptionsForRuntime0280WithError = DefaultDeleteContextOutputOptionsWithError(core.Version0280, common.CompatibilityTestOne) - b.DeleteContextOutputOptionsForRuntime090WithError = DefaultDeleteContextOutputOptionsWithError(core.Version090, common.CompatibilityTestOne) - b.DeleteContextOutputOptionsForRuntimeLatestWithError = DefaultDeleteContextOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestOne) -} - -// CreateDeleteContextAPICommands sets api commands for DeleteContext API -func (b *Helper) CreateDeleteContextAPICommands() { - // Create DeleteContext Commands with input and output options - ginkgo.By("Create DeleteContext API Commands") - - deleteContextCmdForRuntimeLatest, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntimeLatest = deleteContextCmdForRuntimeLatest - - deleteContextCmdForRuntime090, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntime090 = deleteContextCmdForRuntime090 - - deleteContextCmdForRuntime0280, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntime0280 = deleteContextCmdForRuntime0280 - - deleteContextCmdForRuntime0254, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntime0254 = deleteContextCmdForRuntime0254 - - deleteContextCmdForRuntime0280WithError, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntime0280, b.DeleteContextOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntime0280WithError = deleteContextCmdForRuntime0280WithError - - deleteContextCmdForRuntimeLatestWithError, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntimeLatest, b.DeleteContextOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntimeLatestWithError = deleteContextCmdForRuntimeLatestWithError - - deleteContextCmdForRuntime090WithError, err := context.NewDeleteContextCommand(b.DeleteContextInputOptionsForRuntime090, b.DeleteContextOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteContextCmdForRuntime090WithError = deleteContextCmdForRuntime090WithError -} - -// SetupGetContextTestInputAndOutputOptions sets input and output options for GetContext API -func (b *Helper) SetupGetContextTestInputAndOutputOptions() { - // Input and Output params for GetContext - ginkgo.By("Setup Input and Output Options for GetContext") - - b.GetContextInputOptionsForRuntimeLatest = DefaultGetContextInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.GetContextInputOptionsForRuntime090 = DefaultGetContextInputOptions(core.Version090, common.CompatibilityTestOne) - b.GetContextInputOptionsForRuntime0280 = DefaultGetContextInputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetContextInputOptionsForRuntime0254 = DefaultGetContextInputOptions(core.Version0254, common.CompatibilityTestOne) - - b.GetContextTwoInputOptionsForRuntimeLatest = DefaultGetContextInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.GetContextTwoInputOptionsForRuntime090 = DefaultGetContextInputOptions(core.Version090, common.CompatibilityTestTwo) - b.GetContextTwoInputOptionsForRuntime0280 = DefaultGetContextInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.GetContextTwoInputOptionsForRuntime0254 = DefaultGetContextInputOptions(core.Version0254, common.CompatibilityTestTwo) - - b.GetContextOutputOptionsForRuntime0280 = DefaultGetContextOutputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntime0254 = DefaultGetContextOutputOptions(core.Version0254, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntime090 = DefaultGetContextOutputOptions(core.Version090, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntimeLatest = DefaultGetContextOutputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.GetContextTwoOutputOptionsForRuntimeLatest = DefaultGetContextOutputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.GetContextTwoOutputOptionsForRuntime090 = DefaultGetContextOutputOptions(core.Version090, common.CompatibilityTestTwo) - b.GetContextTwoOutputOptionsForRuntime0280 = DefaultGetContextOutputOptions(core.Version0280, common.CompatibilityTestTwo) - b.GetContextTwoOutputOptionsForRuntime0254 = DefaultGetContextOutputOptions(core.Version0254, common.CompatibilityTestTwo) - - b.GetContextOutputOptionsForRuntime090WithError = DefaultGetContextOutputOptionsWithError(core.Version090, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntimeLatestWithError = DefaultGetContextOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntime0280WithError = DefaultGetContextOutputOptionsWithError(core.Version0280, common.CompatibilityTestOne) - b.GetContextOutputOptionsForRuntime0254WithError = DefaultGetContextOutputOptionsWithError(core.Version0254, common.CompatibilityTestOne) - - b.GetContextTwoOutputOptionsForRuntimeLatestWithError = DefaultGetContextOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestTwo) - b.GetContextTwoOutputOptionsForRuntime090WithError = DefaultGetContextOutputOptionsWithError(core.Version090, common.CompatibilityTestTwo) - b.GetContextTwoOutputOptionsForRuntime0280WithError = DefaultGetContextOutputOptionsWithError(core.Version0280, common.CompatibilityTestTwo) -} - -// CreateGetContextAPICommands sets api commands for GetContext API -func (b *Helper) CreateGetContextAPICommands() { - // Create GetContext Commands with input and output options - ginkgo.By("Create GetContext API Commands") - - getContextCmdForRuntimeLatest, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntimeLatest, b.GetContextOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntimeLatest = getContextCmdForRuntimeLatest - - getContextCmdForRuntime090, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime090, b.GetContextOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime090 = getContextCmdForRuntime090 - - getContextCmdForRuntime0280, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime0280, b.GetContextOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime0280 = getContextCmdForRuntime0280 - - getContextCmdForRuntime0254, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime0254, b.GetContextOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime0254 = getContextCmdForRuntime0254 - - getContextTwoCmdForRuntimeLatest, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntimeLatest, b.GetContextTwoOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntimeLatest = getContextTwoCmdForRuntimeLatest - - getContextTwoCmdForRuntime090, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntime090, b.GetContextTwoOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntime090 = getContextTwoCmdForRuntime090 - - getContextTwoCmdForRuntime0280, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntime0280, b.GetContextTwoOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntime0280 = getContextTwoCmdForRuntime0280 - - getContextTwoCmdForRuntime0254, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntime0254, b.GetContextTwoOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntime0254 = getContextTwoCmdForRuntime0254 - - getContextCmdForRuntimeLatestWithError, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntimeLatest, b.GetContextOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntimeLatestWithError = getContextCmdForRuntimeLatestWithError - - getContextCmdForRuntime090WithError, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime090, b.GetContextOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime090WithError = getContextCmdForRuntime090WithError - - getContextCmdForRuntime0280WithError, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime0280, b.GetContextOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime0280WithError = getContextCmdForRuntime0280WithError - - getContextCmdForRuntime0254WithError, err := context.NewGetContextCommand(b.GetContextInputOptionsForRuntime0254, b.GetContextOutputOptionsForRuntime0254WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextCmdForRuntime0254WithError = getContextCmdForRuntime0254WithError - - getContextTwoCmdForRuntimeLatestWithError, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntimeLatest, b.GetContextTwoOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntimeLatestWithError = getContextTwoCmdForRuntimeLatestWithError - - getContextTwoCmdForRuntime090WithError, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntime090, b.GetContextTwoOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntime090WithError = getContextTwoCmdForRuntime090WithError - - getContextTwoCmdForRuntime0280WithError, err := context.NewGetContextCommand(b.GetContextTwoInputOptionsForRuntime0280, b.GetContextTwoOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetContextTwoCmdForRuntime0280WithError = getContextTwoCmdForRuntime0280WithError -} - -// SetupGetCurrentContextTestInputAndOutputOptions sets input and output options for GetCurrentContext API -func (b *Helper) SetupGetCurrentContextTestInputAndOutputOptions() { - // Input and Output Parameters for GetCurrentContext - ginkgo.By("Setup Input and Output Options for GetCurrentContext") - - b.GetCurrentContextInputOptionsForRuntimeLatest = DefaultGetCurrentContextInputOptions(core.VersionLatest) - b.GetCurrentContextInputOptionsForRuntime090 = DefaultGetCurrentContextInputOptions(core.Version090) - - b.GetCurrentContextInputOptionsForRuntime0280 = DefaultGetCurrentContextInputOptions(core.Version0280) - b.GetCurrentContextInputOptionsForRuntime0254 = DefaultGetCurrentContextInputOptions(core.Version0254) - - b.GetCurrentContextOutputOptionsForRuntime0280 = DefaultGetCurrentContextOutputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetCurrentContextOutputOptionsForRuntime0254 = DefaultGetCurrentContextOutputOptions(core.Version0254, common.CompatibilityTestOne) - b.GetCurrentContextOutputOptionsForRuntime090 = DefaultGetCurrentContextOutputOptions(core.Version090, common.CompatibilityTestOne) - b.GetCurrentContextOutputOptionsForRuntimeLatest = DefaultGetCurrentContextOutputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.GetCurrentContextOutputOptionsForRuntimeLatestWithError = DefaultGetCurrentContextOutputOptionsWithError(core.VersionLatest) - b.GetCurrentContextOutputOptionsForRuntime090WithError = DefaultGetCurrentContextOutputOptionsWithError(core.Version090) - b.GetCurrentContextOutputOptionsForRuntime0280WithError = DefaultGetCurrentContextOutputOptionsWithError(core.Version0280) - b.GetCurrentContextOutputOptionsForRuntime0254WithError = DefaultGetCurrentContextOutputOptionsWithError(core.Version0254) -} - -// CreateGetCurrentContextAPICommands sets api commands for GetCurrentContext API -func (b *Helper) CreateGetCurrentContextAPICommands() { - // Create GetCurrentContext Commands with input and output options - ginkgo.By("Create GetCurrentContext API Commands") - - getCurrentContextCmdForRuntimeLatest, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntimeLatest, b.GetCurrentContextOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntimeLatest = getCurrentContextCmdForRuntimeLatest - - getCurrentContextCmdForRuntime090, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime090, b.GetCurrentContextOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime090 = getCurrentContextCmdForRuntime090 - - getCurrentContextCmdForRuntime0280, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime0280, b.GetCurrentContextOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime0280 = getCurrentContextCmdForRuntime0280 - - getCurrentContextCmdForRuntime0254, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime0254, b.GetCurrentContextOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime0254 = getCurrentContextCmdForRuntime0254 - - getCurrentContextCmdForRuntimeLatestWithError, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntimeLatest, b.GetCurrentContextOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntimeLatestWithError = getCurrentContextCmdForRuntimeLatestWithError - - getCurrentContextCmdForRuntime090WithError, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime090, b.GetCurrentContextOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime090WithError = getCurrentContextCmdForRuntime090WithError - - getCurrentContextCmdForRuntime0280WithError, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime0280, b.GetCurrentContextOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime0280WithError = getCurrentContextCmdForRuntime0280WithError - - getCurrentContextCmdForRuntime0254WithError, err := context.NewGetCurrentContextCommand(b.GetCurrentContextInputOptionsForRuntime0254, b.GetCurrentContextOutputOptionsForRuntime0254WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentContextCmdForRuntime0254WithError = getCurrentContextCmdForRuntime0254WithError -} - -// SetupSetCurrentContextTestInputAndOutputOptions sets input and output options for SetCurrentContext API -func (b *Helper) SetupSetCurrentContextTestInputAndOutputOptions() { - // Input and Output Parameters for SetCurrentContext - ginkgo.By("Setup Input and Output Options for SetCurrentContext") - - b.SetCurrentContextInputOptionsForRuntimeLatest = DefaultSetCurrentContextInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.SetCurrentContextInputOptionsForRuntime090 = DefaultSetCurrentContextInputOptions(core.Version090, common.CompatibilityTestOne) - b.SetCurrentContextInputOptionsForRuntime0280 = DefaultSetCurrentContextInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetCurrentContextInputOptionsForRuntime0254 = DefaultSetCurrentContextInputOptions(core.Version0254, common.CompatibilityTestOne) -} - -// CreateSetCurrentContextAPICommands sets api commands for SetCurrentContext API -func (b *Helper) CreateSetCurrentContextAPICommands() { - // Create SetCurrentContext Commands with input and output options - ginkgo.By("Create SetCurrentContext API Commands") - - setCurrentContextCmdForRuntimeLatest, err := context.NewSetCurrentContextCommand(b.SetCurrentContextInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentContextCmdForRuntimeLatest = setCurrentContextCmdForRuntimeLatest - - setCurrentContextCmdForRuntime090, err := context.NewSetCurrentContextCommand(b.SetCurrentContextInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentContextCmdForRuntime090 = setCurrentContextCmdForRuntime090 - - setCurrentContextCmdForRuntime0280, err := context.NewSetCurrentContextCommand(b.SetCurrentContextInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentContextCmdForRuntime0280 = setCurrentContextCmdForRuntime0280 - - setCurrentContextCmdForRuntime0254, err := context.NewSetCurrentContextCommand(b.SetCurrentContextInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentContextCmdForRuntime0254 = setCurrentContextCmdForRuntime0254 -} - -// SetupSetContextTestInputAndOutputOptions sets input and output options for SetContext API -func (b *Helper) SetupSetContextTestInputAndOutputOptions() { - // Input and Output Parameters for SetContext - ginkgo.By("Setup Input and Output Options for SetContext") - - b.SetContextInputOptionsForRuntimeLatest = DefaultSetContextInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime090 = DefaultSetContextInputOptions(core.Version090, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime0280 = DefaultSetContextInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime0254 = DefaultSetContextInputOptions(core.Version0254, common.CompatibilityTestOne) - - b.SetContextTwoInputOptionsForRuntimeLatest = DefaultSetContextInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime090 = DefaultSetContextInputOptions(core.Version090, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime0280 = DefaultSetContextInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime0254 = DefaultSetContextInputOptions(core.Version0254, common.CompatibilityTestTwo) - - // Input and Output Parameters for SetContext - b.SetContextInputOptionsForRuntimeLatest = DefaultSetContextInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime090 = DefaultSetContextInputOptions(core.Version090, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime0280 = DefaultSetContextInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetContextInputOptionsForRuntime0254 = DefaultSetContextInputOptions(core.Version0254, common.CompatibilityTestOne) - - b.SetContextTwoInputOptionsForRuntimeLatest = DefaultSetContextInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime090 = DefaultSetContextInputOptions(core.Version090, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime0280 = DefaultSetContextInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.SetContextTwoInputOptionsForRuntime0254 = DefaultSetContextInputOptions(core.Version0254, common.CompatibilityTestTwo) -} - -// CreateSetContextAPICommands sets api commands for SetContext API -func (b *Helper) CreateSetContextAPICommands() { - // Create SetContext Commands with input and output options - ginkgo.By("Create SetContext API Commands") - - setContextCmdForRuntimeLatest, err := context.NewSetContextCommand(b.SetContextInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextCmdForRuntimeLatest = setContextCmdForRuntimeLatest - - setContextCmdForRuntime090, err := context.NewSetContextCommand(b.SetContextInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextCmdForRuntime090 = setContextCmdForRuntime090 - - setContextCmdForRuntime0254, err := context.NewSetContextCommand(b.SetContextInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextCmdForRuntime0254 = setContextCmdForRuntime0254 - - setContextCmdForRuntime0280, err := context.NewSetContextCommand(b.SetContextInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextCmdForRuntime0280 = setContextCmdForRuntime0280 - - setContextTwoCmdForRuntimeLatest, err := context.NewSetContextCommand(b.SetContextTwoInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextTwoCmdForRuntimeLatest = setContextTwoCmdForRuntimeLatest - - setContextTwoCmdForRuntime090, err := context.NewSetContextCommand(b.SetContextTwoInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextTwoCmdForRuntime090 = setContextTwoCmdForRuntime090 - - setContextTwoCmdForRuntime0254, err := context.NewSetContextCommand(b.SetContextTwoInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextTwoCmdForRuntime0254 = setContextTwoCmdForRuntime0254 - - setContextTwoCmdForRuntime0280, err := context.NewSetContextCommand(b.SetContextTwoInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetContextTwoCmdForRuntime0280 = setContextTwoCmdForRuntime0280 -} - -// DefaultSetContextInputOptions helper method to construct SetContext API input options -func DefaultSetContextInputOptions(version core.RuntimeVersion, contextName string) *context.SetContextInputOptions { - switch version { - case core.VersionLatest: - return &context.SetContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - ContextType: types.ContextTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: "default-compatibility-test-endpoint", - }, - }, - } - case core.Version090, core.Version0280: - return &context.SetContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: "default-compatibility-test-endpoint", - }, - }, - } - case core.Version0254: - return &context.SetContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Type: types.CtxTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: "default-compatibility-test-endpoint", - }, - }, - } - } - return nil -} - -// DefaultGetContextInputOptions helper method to construct GetContext API input options -func DefaultGetContextInputOptions(version core.RuntimeVersion, contextName string) *context.GetContextInputOptions { - return &context.GetContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextName: contextName, - } -} - -// DefaultGetContextOutputOptions helper method to construct GetContext API output options -func DefaultGetContextOutputOptions(version core.RuntimeVersion, contextName string) *context.GetContextOutputOptions { - switch version { - case core.VersionLatest: - return &context.GetContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - ContextType: types.ContextTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version090, core.Version0280: - return &context.GetContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version0254: - return &context.GetContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Type: types.CtxTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - } - } - return nil -} - -// DefaultGetContextOutputOptionsWithError helper method to construct GetContext API output options with error -func DefaultGetContextOutputOptionsWithError(version core.RuntimeVersion, contextName string) *context.GetContextOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &context.GetContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("context %v not found", contextName), - } - case core.Version0254: - return &context.GetContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - Error: fmt.Sprintf("could not find context \"%v\"", contextName), - } - } - return nil -} - -// DefaultSetCurrentContextInputOptions helper method to construct SetCurrentContext API input options -func DefaultSetCurrentContextInputOptions(version core.RuntimeVersion, contextName string) *context.SetCurrentContextInputOptions { - return &context.SetCurrentContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextName: contextName, - } -} - -// DefaultGetCurrentContextInputOptions helper method to construct GetCurrentContext API input options -func DefaultGetCurrentContextInputOptions(version core.RuntimeVersion) *context.GetCurrentContextInputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &context.GetCurrentContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Target: types.TargetK8s, - } - case core.Version0254: - return &context.GetCurrentContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - ContextType: types.CtxTypeK8s, - } - } - return nil -} - -// DefaultGetCurrentContextOutputOptions helper method to construct GetCurrentContext API output options -func DefaultGetCurrentContextOutputOptions(version core.RuntimeVersion, contextName string) *context.GetCurrentContextOutputOptions { - switch version { - case core.VersionLatest: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.VersionLatest, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - ContextType: types.ContextTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version090, core.Version0280: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.VersionLatest, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Target: types.TargetK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version0254: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - ContextOpts: &types.ContextOpts{ - Name: contextName, - Type: types.CtxTypeK8s, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - } - } - return nil -} - -// DefaultGetCurrentContextOutputOptionsWithError helper method to construct GetCurrentContext API output options with error -func DefaultGetCurrentContextOutputOptionsWithError(version core.RuntimeVersion) *context.GetCurrentContextOutputOptions { //nolint:dupl - switch version { - case core.VersionLatest: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for type \"%v\"", types.TargetK8s), - } - case core.Version090, core.Version0280: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for target \"%v\"", types.TargetK8s), - } - case core.Version0254: - return &context.GetCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for type \"%v\"", types.CtxTypeK8s), - } - } - return nil -} - -// DefaultRemoveCurrentContextInputOptions helper method to construct RemoveCurrentContext API input options -func DefaultRemoveCurrentContextInputOptions(version core.RuntimeVersion) *context.RemoveCurrentContextInputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &context.RemoveCurrentContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Target: types.TargetK8s, - } - } - return nil -} - -// DefaultRemoveCurrentContextOutputOptionsWithError helper method to construct RemoveCurrentContext API output option -func DefaultRemoveCurrentContextOutputOptionsWithError(version core.RuntimeVersion) *context.RemoveCurrentContextOutputOptions { //nolint:dupl - switch version { - case core.VersionLatest: - return &context.RemoveCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for type \"%v\"", types.ContextTypeK8s), - } - case core.Version090, core.Version0280: - return &context.RemoveCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for target \"%v\"", types.TargetK8s), - } - case core.Version0254: - return &context.RemoveCurrentContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("no current context set for type \"%v\"", types.CtxTypeK8s), - } - } - return nil -} - -// DefaultDeleteContextInputOptions helper method to construct DeleteContext API input options -func DefaultDeleteContextInputOptions(version core.RuntimeVersion, contextName string) *context.DeleteContextInputOptions { - return &context.DeleteContextInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ContextName: contextName, - } -} - -// DefaultDeleteContextOutputOptionsWithError helper method to construct DeleteContext API output options -func DefaultDeleteContextOutputOptionsWithError(version core.RuntimeVersion, contextName string) *context.DeleteContextOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &context.DeleteContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("context %v not found", contextName), - } - case core.Version0254: - return &context.DeleteContextOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0254, - }, - Error: fmt.Sprintf("could not find context \"%v\"", contextName), - } - } - return nil -} diff --git a/test/compatibility/framework/compatibilitytests/contextserver/context_and_server_test.go b/test/compatibility/framework/compatibilitytests/contextserver/context_and_server_test.go index 773e61686..cfac283c5 100644 --- a/test/compatibility/framework/compatibilitytests/contextserver/context_and_server_test.go +++ b/test/compatibility/framework/compatibilitytests/contextserver/context_and_server_test.go @@ -6,950 +6,646 @@ package contextserver_test import ( "github.com/onsi/ginkgo/v2" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/context" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/server" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/context" "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/executer" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/server" ) -var _ = ginkgo.Describe("Combination Tests for Context and Server APIs", func() { +var _ = ginkgo.Describe("Combination Tests for Context - Server APIs", func() { // Description on the Tests ginkgo.GinkgoWriter.Println("Get/Set/Delete Context, CurrentContext, Server and CurrentServer API methods are tested for cross-version API compatibility with supported Runtime versions v0.25.4, v0.28.0, latest") // Setup Data - var contextTestHelper context.Helper - var serverTestHelper server.Helper ginkgo.BeforeEach(func() { // Setup mock temporary config files for testing _, cleanup := core.SetupTempCfgFiles() ginkgo.DeferCleanup(func() { cleanup() }) - serverTestHelper.SetUpDefaultData() - contextTestHelper.SetUpDefaultData() }) - ginkgo.Context("using single context and server", func() { + ginkgo.Context("using single context- Server", func() { - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@latest - Set Server@v1.0.2", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext v0.90.0 Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - - // Add SetServer and SetCurrentServer latest Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@latest - Set Server@v0.90.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Set Context@latest - Set Server@v0.25.4", func() { + testCase := core.NewTestCase() - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.25.4", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.28.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@latest - Set Server@v0.28.0", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@v1.0.2 - Set Server@latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@v1.0.2 - Set Server@v0.90.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.25.4", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + ginkgo.It("Set Context@v1.0.2 - Set Server@v0.25.4", func() { + testCase := core.NewTestCase() - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Set Context@v1.0.2 - Set Server@v0.28.0", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.28.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.90.0 - Set Server@latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Set Context@v0.90.0 - Set Server@v1.0.2", func() { + testCase := core.NewTestCase() - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Set Context@v0.90.0 - Set Server@v0.25.4", func() { + testCase := core.NewTestCase() - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.90.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.90.0 - Set Server@v0.28.0", func() { + testCase := core.NewTestCase() - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.25.4", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.28.0 - Set Server@latest", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.28.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.28.0 - Set Server@v0.90.0", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Set Context@v0.28.0 - Set Server@v0.25.4", func() { + testCase := core.NewTestCase() - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime latest", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Set Context@v0.28.0 - Set Server@v1.0.2", func() { + testCase := core.NewTestCase() - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.90.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.25.4 - Set Server@latest", func() { + testCase := core.NewTestCase() - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.25.4", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) - - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.25.4 - Set Server@v0.90.0", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.28.0", func() { - // Add SetContext and SetCurrentContext Commands - testCase := core.NewTestCase().Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + ginkgo.It("Set Context@v0.25.4 - Set Server@v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetClientConfig Commands on all supported runtime versions - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + addTestCasesToVerifyContextAndServer(testCase) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Set Context@v0.25.4 - Set Server@v0.28.0", func() { + testCase := core.NewTestCase() - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyContextAndServer(testCase) - // Run all the commands executer.Execute(testCase) }) }) - ginkgo.Context("using two different contexts and servers", func() { + ginkgo.Context("using two different contexts- Servers", func() { - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@v0.90.0 - Set Server@latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetContextTwoCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@v0.90.0 - Set Server@v1.0.2", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetServerTwoCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.25.4", func() { + ginkgo.It("Set Context@v0.90.0 - Set Server@v0.25.4", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetContextTwoCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetServerTwoCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.90.0 and Set Server with Runtime v0.28.0", func() { + ginkgo.It("Set Context@v0.90.0 - Set Server@v0.28.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime090).Add(contextTestHelper.SetContextTwoCmdForRuntime090).Add(contextTestHelper.SetCurrentContextCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetServerTwoCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@latest - Set Server@latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@latest - Set Server@v0.90.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetServerTwoCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.25.4", func() { + ginkgo.It("Set Context@latest - Set Server@v0.25.4", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetServerTwoCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime Latest and Set Server with Runtime v0.28.0", func() { + ginkgo.It("Set Context@latest - Set Server@v0.28.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntimeLatest).Add(contextTestHelper.SetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.SetCurrentContextCmdForRuntimeLatest) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetServerTwoCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + testCase.Add(context.SetContextCommand()) + testCase.Add(context.SetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand()) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@v0.28.0 - Set Server@latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetContextTwoCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@v0.28.0 - Set Server@v0.90.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetContextTwoCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetServerTwoCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.25.4", func() { + ginkgo.It("Set Context@v0.28.0 - Set Server@v0.25.4", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetContextTwoCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetServerTwoCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.28.0 and Set Server with Runtime v0.28.0", func() { + ginkgo.It("Set Context@v0.28.0 - Set Server@v1.0.2", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0280).Add(contextTestHelper.SetContextTwoCmdForRuntime0280).Add(contextTestHelper.SetCurrentContextCmdForRuntime0280) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetServerTwoCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime latest", func() { + ginkgo.It("Set Context@v0.25.4 - Set Server@latest", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetContextTwoCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand()) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.90.0", func() { + ginkgo.It("Set Context@v0.25.4 - Set Server@v0.90.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetContextTwoCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) - - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime090).Add(serverTestHelper.SetServerTwoCmdForRuntime090).Add(serverTestHelper.SetCurrentServerCmdForRuntime090) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.25.4", func() { + ginkgo.It("Set Context@v0.25.4 - Set Server@v1.0.2", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetContextTwoCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetServerTwoCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextCmdForRuntime090WithError).Add(contextTestHelper.GetContextCmdForRuntime0280WithError).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatestWithError).Add(contextTestHelper.GetContextTwoCmdForRuntime090WithError).Add(contextTestHelper.GetContextTwoCmdForRuntime0280WithError).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Set Context with Runtime v0.25.4 and Set Server with Runtime v0.28.0", func() { + ginkgo.It("Set Context@v0.25.4 - Set Server@v0.28.0", func() { testCase := core.NewTestCase() - // Add SetContext and SetCurrentContext Commands - testCase.Add(contextTestHelper.SetContextCmdForRuntime0254).Add(contextTestHelper.SetContextTwoCmdForRuntime0254).Add(contextTestHelper.SetCurrentContextCmdForRuntime0254) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254))) + testCase.Add(context.SetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) - // Add SetServer and SetCurrentServer Commands - testCase.Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetServerTwoCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + testCase.Add(context.SetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest).Add(contextTestHelper.GetContextCmdForRuntime090).Add(contextTestHelper.GetContextCmdForRuntime0280).Add(contextTestHelper.GetContextCmdForRuntime0254) - testCase.Add(contextTestHelper.GetContextTwoCmdForRuntimeLatest).Add(contextTestHelper.GetContextTwoCmdForRuntime090).Add(contextTestHelper.GetContextTwoCmdForRuntime0280).Add(contextTestHelper.GetContextTwoCmdForRuntime0254) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) - // Add GetServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest).Add(contextTestHelper.GetCurrentContextCmdForRuntime090).Add(contextTestHelper.GetCurrentContextCmdForRuntime0280).Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) + addTestCasesToVerifyTwoContextsAndServers(testCase) - // Add GetCurrentServer latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands executer.Execute(testCase) }) }) }) + +func addTestCasesToVerifyContextAndServer(testCase *core.TestCase) { + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) +} + +func addTestCasesToVerifyTwoContextsAndServers(testCase *core.TestCase) { + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.GetContextCommand(context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version102), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version090), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0280), context.WithContextName(common.CompatibilityTestTwo))) + testCase.Add(context.GetContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithContextName(common.CompatibilityTestTwo))) + + 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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) +} diff --git a/test/compatibility/framework/compatibilitytests/envflags/envflags_test.go b/test/compatibility/framework/compatibilitytests/envflags/envflags_test.go index 9251d2283..b63c46e73 100644 --- a/test/compatibility/framework/compatibilitytests/envflags/envflags_test.go +++ b/test/compatibility/framework/compatibilitytests/envflags/envflags_test.go @@ -31,7 +31,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func ginkgo.Context("using single env flag", func() { - ginkgo.It("Run SetEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv latest - DeleteEnv v0.90.0", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -39,6 +39,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -51,6 +52,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -60,7 +62,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv latest - DeleteEnv v1.0.2 ", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -68,6 +70,38 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv latest - DeleteEnv v0.28.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.VersionLatest)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -80,6 +114,39 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv v0.90.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version102)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -89,8 +156,70 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv latest", func() { + // Build test case with commands - ginkgo.It("Run SetEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version102)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv v0.28.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version102)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.28.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv latest", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -98,6 +227,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -110,6 +240,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -119,7 +250,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv v1.0.2", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -127,6 +258,38 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv latest Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv v0.28.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version090)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -139,6 +302,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -149,7 +313,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func executer.Execute(testCase) }) - ginkgo.It("Run SetEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv latest", func() { // Build test case with commands // Add SetEnv Commands of Runtime v0.28.0 @@ -157,6 +321,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -169,6 +334,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -178,14 +344,15 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv v1.0.2", func() { // Build test case with commands - // Add SetEnv Commands of Runtime Latest + // Add SetEnv Commands of Runtime v0.28.0 testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version0280)) // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) @@ -194,10 +361,11 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) // Add DeleteEnv latest Command - testCase.Add(envflags.DefaultDeleteEnvCommand(core.VersionLatest)) + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102)) // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) @@ -207,12 +375,42 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv v0.90.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase().Add(envflags.DefaultSetEnvCommand(core.Version0280)) + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv latest Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version090)) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(map[string]string{}), envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) }) ginkgo.Context("using multiple env flags", func() { - ginkgo.It("Run SetEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv latest - DeleteEnv v0.28.0", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -223,9 +421,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -237,9 +438,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) @@ -249,7 +453,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest then DeleteEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv latest - DeleteEnv v0.90.0", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -260,10 +464,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -275,9 +481,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) @@ -287,8 +496,181 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetEnv latest - DeleteEnv v1.0.2", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.VersionLatest)) + testCase.Add(envflags.DefaultSetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) - ginkgo.It("Run SetEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0 latest then DeleteEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv v0.28.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102)) + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.28.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv v0.90.0", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102)) + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv v1.0.2 - DeleteEnv latest", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102)) + testCase.Add(envflags.DefaultSetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.90.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv v0.28.0", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -299,10 +681,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -314,9 +698,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) @@ -326,7 +713,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0 latest then DeleteEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv latest", func() { // Build test case with commands // Add SetEnv Commands of Runtime Latest @@ -337,10 +724,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -352,9 +741,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) @@ -364,8 +756,50 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetEnv v0.90.0 - DeleteEnv v1.0.2", func() { + // Build test case with commands - ginkgo.It("Run SetEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, latest then DeleteEnv latest then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + // Add SetEnv Commands of Runtime Latest + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.Version090)) + testCase.Add(envflags.DefaultSetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv latest Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv latest", func() { // Build test case with commands // Add SetEnv Commands of Runtime v0.28.0 @@ -376,10 +810,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -391,10 +827,55 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithStrictValidationStrategy())) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv v1.0.2", func() { + // Build test case with commands + + // Add SetEnv Commands of Runtime v0.28.0 + testCase := core.NewTestCase() + + testCase.Add(envflags.DefaultSetEnvCommand(core.Version0280)) + testCase.Add(envflags.DefaultSetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) + + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + + // Add GetEnvConfigurations v0.25.4, v0.11.6 Commands + testCase.Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0254, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())).Add(envflags.DefaultGetEnvConfigurationsCommand(core.Version0116, envflags.WithEnvs(multipleTestEnvs), envflags.WithStrictValidationStrategy())) + + // Add DeleteEnv v0.28.0 Command + testCase.Add(envflags.DefaultDeleteEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne))) + + // Add GetEnv latest, v0.90.0, v0.28.0 Commands + testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) @@ -404,7 +885,7 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetEnv v0.28.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, latest then DeleteEnv v0.90.0 then GetEnv v0.11.6, v0.25.4, v0.28.0, v0.90.0, latest", func() { + ginkgo.It("Run SetEnv v0.28.0 - DeleteEnv v0.90.0", func() { // Build test case with commands // Add SetEnv Commands of Runtime v0.28.0 @@ -415,10 +896,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithValue(envflags.CompatibilityTestsEnvVal), envflags.WithStrictValidationStrategy())) @@ -430,10 +913,12 @@ var _ = ginkgo.Describe("Cross-version Env Flags APIs compatibility tests", func // Add GetEnv latest, v0.90.0, v0.28.0 Commands testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithStrictValidationStrategy())) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithStrictValidationStrategy())) testCase.Add(envflags.DefaultGetEnvCommand(core.VersionLatest, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) + testCase.Add(envflags.DefaultGetEnvCommand(core.Version102, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version090, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) testCase.Add(envflags.DefaultGetEnvCommand(core.Version0280, envflags.WithKey(envflags.CompatibilityTestsEnvOne), envflags.WithError(common.ErrNotFound))) diff --git a/test/compatibility/framework/compatibilitytests/featureflags/featureflags_test.go b/test/compatibility/framework/compatibilitytests/featureflags/featureflags_test.go index 89caff8ce..72f2f66db 100644 --- a/test/compatibility/framework/compatibilitytests/featureflags/featureflags_test.go +++ b/test/compatibility/framework/compatibilitytests/featureflags/featureflags_test.go @@ -31,7 +31,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", ginkgo.Context("using default single feature flag", func() { - ginkgo.It("Run SetFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature latest - DeleteFeature v0.28.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -39,6 +39,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -46,6 +47,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -56,6 +58,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -64,7 +67,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature latest - DeleteFeature v0.90.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -72,6 +75,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -79,6 +83,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -89,6 +94,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -97,8 +103,154 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetFeature latest - DeleteFeature v1.0.2", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.VersionLatest)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature v0.28.0", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.28.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version0280)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature v0.90.0", func() { + // Build test case with commands - ginkgo.It("Run SetFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version090)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature latest", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature v0.28.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -106,6 +258,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -113,6 +266,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -123,6 +277,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -131,7 +286,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature latest", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -139,6 +294,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -146,6 +302,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -156,6 +313,43 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature v1.0.2", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.Version090)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -165,7 +359,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", executer.Execute(testCase) }) - ginkgo.It("Run SetFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature latest", func() { // Build test case with commands // Add SetFeature Commands of Runtime v0.28.0 @@ -173,6 +367,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -180,6 +375,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -190,6 +386,43 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature v1.0.2", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime v0.28.0 + testCase := core.NewTestCase().Add(featureflags.DefaultSetFeatureCommand(core.Version0280)) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -198,7 +431,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature v0.90.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime v0.28.0 @@ -206,6 +439,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -213,6 +447,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) @@ -223,6 +458,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -232,7 +468,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.25.4 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteFeature latest", func() { // Build test case with commands testCase := core.NewTestCase() @@ -242,6 +478,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -259,6 +496,44 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteFeature v1.0.2", func() { + // Build test case with commands + + testCase := core.NewTestCase() + + // Add StoreClientConfig Command for Runtime v0.25.4 + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultFeatureFlags())) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest)) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090)) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280)) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254)) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116)) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -267,7 +542,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.25.4 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteFeature v0.90.0", func() { // Build test case with commands testCase := core.NewTestCase() @@ -277,6 +552,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -294,6 +570,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -302,7 +579,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.25.4 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteFeature v0.28.0", func() { // Build test case with commands testCase := core.NewTestCase() @@ -312,6 +589,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultFeatureFlags())) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultFeatureFlags())) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultFeatureFlags())) @@ -325,10 +603,11 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116)) // Add DeleteFeature latest Command - testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version0280)) // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) @@ -342,7 +621,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", ginkgo.Context("using default multiple feature flag", func() { - ginkgo.It("Run SetFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature latest - DeleteFeature v0.28.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -368,6 +647,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -375,11 +655,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -390,11 +672,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -408,6 +692,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -416,7 +701,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature latest - DeleteFeature v0.90.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest @@ -442,6 +727,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -449,11 +735,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -464,11 +752,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -482,6 +772,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -490,14 +781,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - - ginkgo.It("Run SetFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature latest - DeleteFeature v1.0.2", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest testCase := core.NewTestCase() - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090)) - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.VersionLatest)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) // Add StoreClientConfig latest Commands features := map[string]types.FeatureMap{ @@ -517,6 +807,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -524,26 +815,30 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) - // Add DeleteFeature v0.28.0 Command - testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version0280)) + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -557,6 +852,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -565,13 +861,14 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature v0.28.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime Latest testCase := core.NewTestCase() - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090)) - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) // Add StoreClientConfig latest Commands features := map[string]types.FeatureMap{ @@ -591,6 +888,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -598,26 +896,30 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) - // Add DeleteFeature latest Command - testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + // Add DeleteFeature v0.28.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version0280)) // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -631,6 +933,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -639,22 +942,22 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - - ginkgo.It("Run SetFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature latest then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature v0.90.0", func() { // Build test case with commands - // Add SetFeature Commands of Runtime v0.28.0 + // Add SetFeature Commands of Runtime Latest testCase := core.NewTestCase() - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280)) - testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) - // Add StoreClientConfig v0.28.0 Commands + // Add StoreClientConfig latest Commands features := map[string]types.FeatureMap{ featureflags.CompatibilityTestsPlugin: map[string]string{ featureflags.CompatibilityTestsPluginKey1: "true", }, } - testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands features = map[string]types.FeatureMap{ @@ -665,6 +968,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -672,26 +976,510 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) - // Add DeleteFeature latest Command - testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version090)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v1.0.2 - DeleteFeature latest", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig latest Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.90.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature v0.28.0", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig latest Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature v0.28.0 Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version0280)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature v1.0.2", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig latest Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v0.90.0 - DeleteFeature latest", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime Latest + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig latest Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature latest", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime v0.28.0 + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig v0.28.0 Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.VersionLatest)) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature v1.0.2", func() { + // Build test case with commands + + // Add SetFeature Commands of Runtime v0.28.0 + testCase := core.NewTestCase() + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280)) + testCase.Add(featureflags.DefaultSetFeatureCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"))) + + // Add StoreClientConfig v0.28.0 Commands + features := map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + + // Add GetClientConfig latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + features = map[string]types.FeatureMap{ + featureflags.CompatibilityTestsPlugin: map[string]string{ + featureflags.CompatibilityTestsPluginKey: "true", + featureflags.CompatibilityTestsPluginKey0: "false", + featureflags.CompatibilityTestsPluginKey1: "true", + }, + } + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithFeatureFlags(features))) + + // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + + // Add DeleteFeature latest Command + testCase.Add(featureflags.DefaultDeleteFeatureCommand(core.Version102)) // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -705,6 +1493,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -713,7 +1502,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetFeature v0.28.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest then DeleteFeature v0.90.0 then IsFeatureEnabled v0.11.6, v0.25.4, v0.28.0, latest", func() { + ginkgo.It("Run SetFeature v0.28.0 - DeleteFeature v0.90.0", func() { // Build test case with commands // Add SetFeature Commands of Runtime v0.28.0 @@ -738,6 +1527,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) @@ -745,11 +1535,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -760,11 +1552,13 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", // Add IsFeatureEnabled latest, v0.90.0, v0.28.0, v0.25.4, v0.11.6 Commands testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithError(common.ErrNotFound))) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0116, featureflags.WithError(common.ErrNotFound))) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.VersionLatest, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) + testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version102, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version090, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0280, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) testCase.Add(featureflags.DefaultIsFeatureEnabledCommand(core.Version0254, featureflags.WithKey(featureflags.CompatibilityTestsPluginKey0), featureflags.WithValue("false"), featureflags.WithStrictValidationStrategy())) @@ -778,6 +1572,7 @@ var _ = ginkgo.Describe("Cross-version Feature Flags APIs compatibility tests", }, } testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithFeatureFlags(features))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithFeatureFlags(features))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithFeatureFlags(features))) diff --git a/test/compatibility/framework/compatibilitytests/legacyclientconfig/legacyclientconfig_test.go b/test/compatibility/framework/compatibilitytests/legacyclientconfig/legacyclientconfig_test.go index 4384332b1..59d290ee2 100644 --- a/test/compatibility/framework/compatibilitytests/legacyclientconfig/legacyclientconfig_test.go +++ b/test/compatibility/framework/compatibilitytests/legacyclientconfig/legacyclientconfig_test.go @@ -6,258 +6,440 @@ package legacyclientconfig_test import ( "github.com/onsi/ginkgo/v2" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/context" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/context" "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/executer" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/legacyclientconfig" ) var _ = ginkgo.Describe("Cross-version Legacy Client Config APIs compatibility tests", func() { ginkgo.GinkgoWriter.Println("GetClientConfig, StoreClientConfig methods are tested for cross-version API compatibility with supported Runtime versions v0.11.6, v0.25.4, v0.28.0, latest") - // Setup Data - var contextTestHelper context.Helper ginkgo.BeforeEach(func() { // Setup mock temporary config files for testing _, cleanup := core.SetupTempCfgFiles() ginkgo.DeferCleanup(func() { cleanup() }) - contextTestHelper.SetUpDefaultData() }) ginkgo.Context("involving context", func() { - ginkgo.It("Run StoreClientConfig latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest + ginkgo.It("Run StoreClientConfig latest - DeleteContext, RemoveCurrentContext v0.28.0", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) - - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + 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())) + executer.Execute(testCase) }) + ginkgo.It("Run StoreClientConfig latest - DeleteContext, RemoveCurrentContext v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - ginkgo.It("Run StoreClientConfig latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.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())) + + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig latest - DeleteContext, RemoveCurrentContext v1.0.2", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.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())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run StoreClientConfig v1.0.2 - DeleteContext, RemoveCurrentContext v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + 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())) + + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig v1.0.2 - DeleteContext, RemoveCurrentContext v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version090))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version090))) + + 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.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())) + + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig v1.0.2 - DeleteContext, RemoveCurrentContext latest", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext v0.90.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime090) - - // Add DeleteContext v0.90.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime090) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand()) + testCase.Add(context.DeleteContextCommand()) + + 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.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())) + executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest + ginkgo.It("Run StoreClientConfig v0.90.0 - DeleteContext, RemoveCurrentContext latest", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatest) - - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatest) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand()) + testCase.Add(context.DeleteContextCommand()) + + 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.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())) + executer.Execute(testCase) }) + ginkgo.It("Run StoreClientConfig v0.90.0 - DeleteContext, RemoveCurrentContext v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - ginkgo.It("Run StoreClientConfig v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands for Runtime latest + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version102))) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102))) + + 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.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())) + + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig v0.90.0 - DeleteContext, RemoveCurrentContext v0.28.0", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext v0.28.0 Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime0280) - - // Add DeleteContext v0.28.0 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0280) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.RemoveCurrentContextCommand(context.WithRuntimeVersion(core.Version0280))) + testCase.Add(context.DeleteContextCommand(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), context.WithError())) + + 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())) + executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.28.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands + ginkgo.It("Run StoreClientConfig v0.28.0 - DeleteContext v0.25.4", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.VersionLatest, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) - testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.Version090))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version102, legacyclientconfig.WithDefaultContextAndServer(core.Version102))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version090, legacyclientconfig.WithDefaultContextAndServer(core.VersionLatest))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0280, legacyclientconfig.WithDefaultContextAndServer(core.Version0280))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add DeleteContext v0.25.4 Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime0254) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254WithError) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatest) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254WithError) - - // Run all the commands + 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.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.WithRuntimeVersion(core.Version0254))) + + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version0254))) + + 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.WithRuntimeVersion(core.Version0254), 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))) + testCase.Add(context.GetCurrentContextCommand(context.WithRuntimeVersion(core.Version0254), context.WithError())) + executer.Execute(testCase) }) - ginkgo.It("Run StoreClientConfig v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext latest then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteContext, RemoveCurrentContext latest", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) @@ -265,42 +447,73 @@ 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))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntimeLatestWithError) - - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntimeLatestWithError) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Run all the commands + 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(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.WithError())) + testCase.Add(context.DeleteContextCommand(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))) + + 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))) + executer.Execute(testCase) }) + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteContext, RemoveCurrentContext v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) + testCase.Add(legacyclientconfig.DefaultGetClientConfigCommand(core.Version0116, legacyclientconfig.WithDefaultContextAndServer(core.Version0116))) + + 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(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.Version102), context.WithError())) + testCase.Add(context.DeleteContextCommand(context.WithRuntimeVersion(core.Version102), 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))) + + 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))) - ginkgo.It("Run StoreClientConfig v0.25.4 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest then DeleteContext, RemoveCurrentContext v0.90.0 then GetContext, GetCurrentContext v0.25.4, v0.28.0, latest", func() { - // Add SetContext and SetCurrentContext Commands + executer.Execute(testCase) + }) + ginkgo.It("Run StoreClientConfig v0.25.4 - DeleteContext, RemoveCurrentContext v0.90.0", func() { testCase := core.NewTestCase() testCase.Add(legacyclientconfig.DefaultStoreClientConfigCommand(core.Version0254, legacyclientconfig.WithDefaultContextAndServer(core.Version0254))) @@ -308,37 +521,33 @@ 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))) - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Add RemoveCurrentContext latest Command - testCase.Add(contextTestHelper.RemoveCurrentContextCmdForRuntime090WithError) - - // Add DeleteContext latest Command - testCase.Add(contextTestHelper.DeleteContextCmdForRuntime090WithError) - - // Add GetContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetContextCmdForRuntime0254) - - // Add GetCurrentContext latest, v0.90.0, v0.28.0, v0.25.4 Commands - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntimeLatestWithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime090WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0280WithError) - testCase.Add(contextTestHelper.GetCurrentContextCmdForRuntime0254) - - // Run all the commands + 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(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), 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))) + + 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))) + executer.Execute(testCase) }) diff --git a/test/compatibility/framework/compatibilitytests/metadata/metadata_test.go b/test/compatibility/framework/compatibilitytests/metadata/metadata_test.go index 4190e9085..aaf6b4de2 100644 --- a/test/compatibility/framework/compatibilitytests/metadata/metadata_test.go +++ b/test/compatibility/framework/compatibilitytests/metadata/metadata_test.go @@ -26,7 +26,7 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t ginkgo.Context("using default metadata", func() { - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting latest then Getters for v0.28.0, latest then DeleteConfigMetadataSetting v0.28.0 then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting latest DeleteConfigMetadataSetting v0.28.0", func() { // Build test case with commands // Add SetConfigMetadata Commands of Runtime Latest @@ -35,73 +35,36 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.VersionLatest)) testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.VersionLatest)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) // Add DeleteConfigMetadata v0.28.0 Command testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version0280)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } + verifyAfterDelete(testCase) - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting latest DeleteConfigMetadataSetting v0.90.0", func() { + // Build test case with commands - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + // Add SetConfigMetadata Commands of Runtime Latest + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + // Add DeleteConfigMetadata v0.90.0 Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting latest then Getters for v0.28.0, latest then DeleteConfigMetadataSetting v0.90.0 then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting latest DeleteConfigMetadataSetting v1.0.2", func() { // Build test case with commands // Add SetConfigMetadata Commands of Runtime Latest @@ -110,149 +73,92 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.VersionLatest)) testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.VersionLatest)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) + // Add DeleteConfigMetadata v0.90.0 Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version102)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + verifyAfterDelete(testCase) + // Run all the commands + executer.Execute(testCase) + }) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v1.0.2 DeleteConfigMetadataSetting v0.28.0", func() { + // Build test case with commands - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) + // Add SetConfigMetadata Commands of Runtime Latest + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version102)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version102)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) - // Add DeleteConfigMetadata v0.90.0 Command - testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version090)) + // Add DeleteConfigMetadata v0.28.0 Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version0280)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } + verifyAfterDelete(testCase) - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v1.0.2 DeleteConfigMetadataSetting v0.90.0", func() { + // Build test case with commands - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + // Add SetConfigMetadata Commands of Runtime Latest + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version102)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version102)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + // Add DeleteConfigMetadata v0.90.0 Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) - - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.90.0 then Getters for v0.28.0, latest then DeleteConfigMetadataSetting v0.28.0 then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v1.0.2 DeleteConfigMetadataSetting latest", func() { // Build test case with commands // Add SetConfigMetadata Commands of Runtime Latest testCase := core.NewTestCase() - testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version090)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version102)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version102)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) + // Add DeleteConfigMetadata v0.90.0 Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + verifyAfterDelete(testCase) + // Run all the commands + executer.Execute(testCase) + }) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.90.0 DeleteConfigMetadataSetting v0.28.0", func() { + // Build test case with commands - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) + // Add SetConfigMetadata Commands of Runtime Latest + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version090)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) // Add DeleteConfigMetadata v0.28.0 Command testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version0280)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } - - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.90.0 then Getters for v0.28.0, latest then DeleteConfigMetadataSetting latest then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.90.0 DeleteConfigMetadataSetting v1.0.2", func() { // Build test case with commands // Add SetConfigMetadata Commands of Runtime Latest @@ -261,74 +167,35 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version090)) testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version090)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + // Add DeleteConfigMetadata latest Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version102)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) + verifyAfterDelete(testCase) + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.90.0 DeleteConfigMetadataSetting latest", func() { + // Build test case with commands - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) + // Add SetConfigMetadata Commands of Runtime Latest + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version090)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) // Add DeleteConfigMetadata latest Command testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.VersionLatest)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } - - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.28.0 then Getters for v0.28.0, latest then DeleteConfigMetadataSetting latest then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.28.0 DeleteConfigMetadataSetting latest", func() { // Build test case with commands testCase := core.NewTestCase() @@ -336,73 +203,16 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version0280)) testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version0280)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) // Add DeleteConfigMetadataSetting latest Command testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.VersionLatest)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } - - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.28.0 then Getters for v0.28.0, latest then DeleteConfigMetadataSetting v0.90.0 then Getters for v0.28.0, latest", func() { + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.28.0 DeleteConfigMetadataSetting v1.0.2", func() { // Build test case with commands testCase := core.NewTestCase() @@ -410,69 +220,29 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version0280)) testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version0280)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) + verifyAfterSet(testCase) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) + // Add DeleteConfigMetadataSetting latest Command + testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version102)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) + verifyAfterDelete(testCase) + // Run all the commands + executer.Execute(testCase) + }) + ginkgo.It("Run SetConfigMetadataPatchStrategy, SetConfigMetadataSetting v0.28.0 DeleteConfigMetadataSetting v0.90.0", func() { + // Build test case with commands + testCase := core.NewTestCase() - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) + // Add SetConfigMetadata Commands of Runtime v0.28.0 + testCase.Add(metadata.DefaultSetConfigMetadataPatchStrategyCommand(core.Version0280)) + testCase.Add(metadata.DefaultSetConfigMetadataSettingCommand(core.Version0280)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) + verifyAfterSet(testCase) // Add DeleteConfigMetadataSetting v0.90.0 Command testCase.Add(metadata.DefaultDeleteConfigMetadataSettingCommand(core.Version090)) - // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands - metadataOpts := &types.MetadataOpts{ - ConfigMetadata: &types.ConfigMetadataOpts{ - Settings: map[string]string{}, - }, - } - - testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) - testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) - - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) - - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) - testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) - - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) - testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) - + verifyAfterDelete(testCase) // Run all the commands executer.Execute(testCase) }) @@ -480,3 +250,79 @@ var _ = ginkgo.Describe("Cross-version ConfigMetadata Flags APIs compatibility t }) }) + +func verifyAfterSet(testCase *core.TestCase) { + // Add GetConfigMetadata latest, v0.90.0, v0.28.0 Commands + testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version102)) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090)) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280)) + + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version102)) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090)) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280)) + + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version102)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version102)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280)) + + testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version102)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version090)) + testCase.Add(metadata.DefaultGetConfigMetadataSettingsCommand(core.Version0280)) + + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version102)) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090)) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280)) + + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version102)) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090)) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280)) +} + +func verifyAfterDelete(testCase *core.TestCase) { + metadataOpts := &types.MetadataOpts{ + ConfigMetadata: &types.ConfigMetadataOpts{ + Settings: map[string]string{}, + }, + } + + testCase.Add(metadata.DefaultGetMetadataCommand(core.VersionLatest, metadata.WithMetadataOpts(metadataOpts))) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version102, metadata.WithMetadataOpts(metadataOpts))) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version090, metadata.WithMetadataOpts(metadataOpts))) + testCase.Add(metadata.DefaultGetMetadataCommand(core.Version0280, metadata.WithMetadataOpts(metadataOpts))) + + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version102, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version090, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version0280, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.VersionLatest)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version102)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version090)) + testCase.Add(metadata.DefaultGetConfigMetadataPatchStrategyCommand(core.Version0280)) + + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.VersionLatest, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + testCase.Add(metadata.DefaultGetConfigMetadataCommand(core.Version102, metadata.WithConfigMetadataOpts(metadataOpts.ConfigMetadata))) + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version090, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultGetConfigMetadataSettingCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version102, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version090, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultIsConfigMetadataSettingsEnabledCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) + + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.VersionLatest, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version102, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version090, metadata.WithError(common.ErrNotFound))) + testCase.Add(metadata.DefaultUseUnifiedConfigCommand(core.Version0280, metadata.WithError(common.ErrNotFound))) +} diff --git a/test/compatibility/framework/compatibilitytests/server/server_test.go b/test/compatibility/framework/compatibilitytests/server/server_test.go index b3fab22a0..294e48dc8 100644 --- a/test/compatibility/framework/compatibilitytests/server/server_test.go +++ b/test/compatibility/framework/compatibilitytests/server/server_test.go @@ -6,19 +6,17 @@ package server_test import ( "github.com/onsi/ginkgo/v2" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/server" - - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/executer" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/executer" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/server" ) -var _ = ginkgo.Describe("Cross-version Server APIs Compatibility Tests for supported Runtime versions v0.11.6, v0.25.4, v0.28.0, latest", func() { +var _ = ginkgo.Describe("Cross-version Server APIs Compatibility Tests", func() { // Description on the Tests - ginkgo.GinkgoWriter.Println("Get/Set/Delete Server and CurrentServer API methods are tested for cross-version API compatibility with supported Runtime versions v0.11.6, v0.25.4, v0.28.0, latest") + ginkgo.GinkgoWriter.Println("Get/Set/Delete Server and CurrentServer API methods are tested for cross-version API compatibility with supported Runtime versions v0.11.6, v0.25.4, v0.28.0, v0.90.0, v1.0.2, latest") // Setup Data - var serverTestHelper server.Helper ginkgo.BeforeEach(func() { // Setup mock temporary config files for testing _, cleanup := core.SetupTempCfgFiles() @@ -26,447 +24,2563 @@ var _ = ginkgo.Describe("Cross-version Server APIs Compatibility Tests for suppo cleanup() }) - serverTestHelper.SetUpDefaultData() }) ginkgo.Context("using single server", func() { - ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer, RemoveCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime Latest version - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add RemoveCurrentServer v0.28.0 Command - testCase.Add(serverTestHelper.RemoveCurrentServerCmdForRuntime0280) - - // Add DeleteServer v0.28.0 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0280) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) - - // Run all the commands - executer.Execute(testCase) - }) - - ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer of Runtime v0.11.6 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime Latest version - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add DeleteServer v0.11.6 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0116) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) - - // Run all the commands - executer.Execute(testCase) - }) - - ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer of Runtime v0.25.4 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime v0.28.0 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add DeleteServer v0.25.4 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0254) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) - - // Run all the commands - executer.Execute(testCase) - }) - - ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer, RemoveCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime v0.25.4 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add RemoveCurrentServer v0.28.0 Command - testCase.Add(serverTestHelper.RemoveCurrentServerCmdForRuntime0280WithError) - - // Add DeleteServer v0.28.0 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0280WithError) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - - // Run all the commands - executer.Execute(testCase) - }) - - ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.11.6 then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer of Runtime 0.25.4 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime v0.11.6 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0116).Add(serverTestHelper.SetCurrentServerCmdForRuntime0116) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add DeleteServer v0.25.4 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0254) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) - - // Run all the commands - executer.Execute(testCase) - }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.11.6 then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer of Runtime latest then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add SetServer and SetCurrentServer Commands of Runtime v0.11.6 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0116).Add(serverTestHelper.SetCurrentServerCmdForRuntime0116) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add DeleteServer latest Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntimeLatestWithError) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Run all the commands executer.Execute(testCase) }) - }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - ginkgo.Context("using multiple servers", func() { + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - ginkgo.It("Run two SetServer of Runtime latest then SetCurrentServer of Runtime latest then GetServer, GetCurrentServer on all supported Runtime library versions and then DeleteServer, RemoveCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add two SetServer Commands of Runtime Latest - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntimeLatest).Add(serverTestHelper.SetServerTwoCmdForRuntimeLatest) - - // Add SetCurrentServer Command of Runtime Latest - testCase.Add(serverTestHelper.SetCurrentServerCmdForRuntimeLatest) - - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) - - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0116) - - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) - - // Add RemoveCurrentServer v0.28.0 Command - testCase.Add(serverTestHelper.RemoveCurrentServerCmdForRuntime0280) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime latest - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add DeleteServer v0.28.0 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0280) + executer.Execute(testCase) + }) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254WithError) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116WithError) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - ginkgo.It("Run two SetServer of Runtime v0.25.4 then SetCurrentServer of Runtime v0.25.4 then GetServer, GetCurrentServer on v0.11.6, v0.25.4, v0.28.0, latest then DeleteServer, RemoveCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add two SetServer Commands of Runtime v0.25.4 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0254).Add(serverTestHelper.SetServerTwoCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add SetCurrentServer Command of Runtime v0.25.4 - testCase.Add(serverTestHelper.SetCurrentServerCmdForRuntime0254) + executer.Execute(testCase) + }) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add RemoveCurrentServer v0.28.0 Command - testCase.Add(serverTestHelper.RemoveCurrentServerCmdForRuntime0280WithError) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add DeleteServer v0.28.0 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0280WithError) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerCmdForRuntime0116) + executer.Execute(testCase) + }) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime090) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0280) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0254) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer,RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime090) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0280) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0254) - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer,RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Run all the commands executer.Execute(testCase) }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer,RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - ginkgo.It("Run two SetServer of Runtime v0.28.0 then SetCurrentServer of Runtime v0.28.0 then GetServer, GetCurrentServer on v0.11.6, v0.25.4, v0.28.0, latest then DeleteServer of Runtime v0.25.4 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add two SetServer Commands of Runtime v0.28.0 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0280).Add(serverTestHelper.SetServerTwoCmdForRuntime0280) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add SetCurrentServer Command of Runtime v0.28.0 - testCase.Add(serverTestHelper.SetCurrentServerCmdForRuntime0280) + executer.Execute(testCase) + }) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254).Add(serverTestHelper.GetServerCmdForRuntime0116) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) - // Add DeleteServer v0.25.4 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError).Add(serverTestHelper.GetServerCmdForRuntime090WithError).Add(serverTestHelper.GetServerCmdForRuntime0280WithError).Add(serverTestHelper.GetServerCmdForRuntime0254WithError).Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) + executer.Execute(testCase) + }) + ginkgo.It("Run SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run two SetServer of Runtime v0.11.6 then SetCurrentServer of Runtime v0.11.6 then GetServer, GetCurrentServer on v0.11.6, v0.25.4, v0.28.0, latest then DeleteServer of Runtime latest then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add two SetServer Commands of Runtime v0.11.6 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0116).Add(serverTestHelper.SetServerTwoCmdForRuntime0116) + }) - // Add SetCurrentServer Command of Runtime v0.11.6 - testCase.Add(serverTestHelper.SetCurrentServerCmdForRuntime0116) + ginkgo.Context("using multiple servers", func() { - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254).Add(serverTestHelper.GetServerCmdForRuntime0116) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add DeleteServer latest Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntimeLatestWithError) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254).Add(serverTestHelper.GetServerCmdForRuntime0116) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime latest - DeleteServer, RemoveCurrentServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand()) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand()) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Run all the commands executer.Execute(testCase) }) - ginkgo.It("Run two SetServer of Runtime v0.11.6 then SetCurrentServer of Runtime v0.11.6 then GetServer, GetCurrentServer on v0.11.6, v0.25.4, v0.28.0, latest then DeleteServer of Runtime v0.25.4 then GetServer, GetCurrentServer on all supported Runtime library versions", func() { - // Add two SetServer Commands of Runtime v0.11.6 - testCase := core.NewTestCase().Add(serverTestHelper.SetServerCmdForRuntime0116).Add(serverTestHelper.SetServerTwoCmdForRuntime0116) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add SetCurrentServer Command of Runtime v0.11.6 - testCase.Add(serverTestHelper.SetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatest).Add(serverTestHelper.GetServerCmdForRuntime090).Add(serverTestHelper.GetServerCmdForRuntime0280).Add(serverTestHelper.GetServerCmdForRuntime0254).Add(serverTestHelper.GetServerCmdForRuntime0116) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatest).Add(serverTestHelper.GetCurrentServerCmdForRuntime090).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add DeleteServer v0.25.4 Command - testCase.Add(serverTestHelper.DeleteServerCmdForRuntime0254) + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v1.0.2 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.90.0 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand()) + testCase.Add(server.DeleteServerCommand()) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Add GetServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetServerCmdForRuntimeLatestWithError).Add(serverTestHelper.GetServerCmdForRuntime090WithError).Add(serverTestHelper.GetServerCmdForRuntime0280WithError).Add(serverTestHelper.GetServerCmdForRuntime0254WithError).Add(serverTestHelper.GetServerCmdForRuntime0116WithError) - testCase.Add(serverTestHelper.GetServerTwoCmdForRuntimeLatest).Add(serverTestHelper.GetServerTwoCmdForRuntime090).Add(serverTestHelper.GetServerTwoCmdForRuntime0280).Add(serverTestHelper.GetServerTwoCmdForRuntime0254).Add(serverTestHelper.GetServerTwoCmdForRuntime0116) + executer.Execute(testCase) + }) - // Add GetCurrentServer Commands on all supported Runtime library versions - testCase.Add(serverTestHelper.GetCurrentServerCmdForRuntimeLatestWithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime090WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0280WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0254WithError).Add(serverTestHelper.GetCurrentServerCmdForRuntime0116WithError) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v0.25.4", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.28.0 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run two SetServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer, RemoveCurrentServer of Runtime v0.28.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.25.4 - DeleteServer of Runtime v0.11.6", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + executer.Execute(testCase) + }) + + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.11.6 - DeleteServer of Runtime latest", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0116))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.11.6 - DeleteServer of Runtime v1.0.2", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0116))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.11.6 - DeleteServer of Runtime v0.90.0", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0116))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.RemoveCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + executer.Execute(testCase) + }) + ginkgo.It("Run two SetServer, SetCurrentServer of Runtime v0.11.6 - DeleteServer of Runtime v0.25.4 ", func() { + testCase := core.NewTestCase() + + testCase.Add(server.SetServerCommand(server.WithRuntimeVersion(core.Version0116))) + testCase.Add(server.SetServerCommand(server.WithServerName(common.CompatibilityTestTwo), server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.SetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand()) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand()) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254))) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116))) + + testCase.Add(server.DeleteServerCommand(server.WithRuntimeVersion(core.Version0254))) + + testCase.Add(server.GetServerCommand(server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) + + testCase.Add(server.GetServerCommand(server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version102), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version090), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithServerName(common.CompatibilityTestTwo))) + testCase.Add(server.GetServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithServerName(common.CompatibilityTestTwo))) + + testCase.Add(server.GetCurrentServerCommand(server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version102), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version090), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0280), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0254), server.WithError())) + testCase.Add(server.GetCurrentServerCommand(server.WithRuntimeVersion(core.Version0116), server.WithError())) - // Run all the commands executer.Execute(testCase) }) }) + }) diff --git a/test/compatibility/framework/compatibilitytests/server/server_test_helpers.go b/test/compatibility/framework/compatibilitytests/server/server_test_helpers.go deleted file mode 100644 index c126ece9e..000000000 --- a/test/compatibility/framework/compatibilitytests/server/server_test_helpers.go +++ /dev/null @@ -1,847 +0,0 @@ -// Copyright 2023 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -// Package server provides cross-version Server API compatibility tests -package server - -import ( - "fmt" - - "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" - - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/server" - "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/types" -) - -const ServerNotFound = "current server \"\" not found in tanzu config" - -// Helper struct provides input and output options and api commands to be used in test cases -type Helper struct { - // SetServer Input Options - SetServerInputOptionsForRuntime0116 *server.SetServerInputOptions - SetServerInputOptionsForRuntime0254 *server.SetServerInputOptions - SetServerInputOptionsForRuntime0280 *server.SetServerInputOptions - SetServerInputOptionsForRuntimeLatest *server.SetServerInputOptions - SetServerInputOptionsForRuntime090 *server.SetServerInputOptions - - SetServerTwoInputOptionsForRuntime0116 *server.SetServerInputOptions - SetServerTwoInputOptionsForRuntime0254 *server.SetServerInputOptions - SetServerTwoInputOptionsForRuntime0280 *server.SetServerInputOptions - SetServerTwoInputOptionsForRuntimeLatest *server.SetServerInputOptions - SetServerTwoInputOptionsForRuntime090 *server.SetServerInputOptions - - // SetCurrentServer Input Options - SetCurrentServerInputOptionsForRuntime0116 *server.SetCurrentServerInputOptions - SetCurrentServerInputOptionsForRuntime0254 *server.SetCurrentServerInputOptions - SetCurrentServerInputOptionsForRuntime0280 *server.SetCurrentServerInputOptions - SetCurrentServerInputOptionsForRuntimeLatest *server.SetCurrentServerInputOptions - SetCurrentServerInputOptionsForRuntime090 *server.SetCurrentServerInputOptions - - // GetServer Input Options - GetServerInputOptionsForRuntimeLatest *server.GetServerInputOptions - GetServerInputOptionsForRuntime090 *server.GetServerInputOptions - GetServerInputOptionsForRuntime0280 *server.GetServerInputOptions - GetServerInputOptionsForRuntime0254 *server.GetServerInputOptions - GetServerInputOptionsForRuntime0116 *server.GetServerInputOptions - - GetServerTwoInputOptionsForRuntimeLatest *server.GetServerInputOptions - GetServerTwoInputOptionsForRuntime090 *server.GetServerInputOptions - GetServerTwoInputOptionsForRuntime0280 *server.GetServerInputOptions - GetServerTwoInputOptionsForRuntime0254 *server.GetServerInputOptions - GetServerTwoInputOptionsForRuntime0116 *server.GetServerInputOptions - - // GetServer Output Options - GetServerOutputOptionsForRuntime0116 *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime0254 *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime0280 *server.GetServerOutputOptions - GetServerOutputOptionsForRuntimeLatest *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime090 *server.GetServerOutputOptions - - GetServerTwoOutputOptionsForRuntime0116 *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntime0254 *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntime0280 *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntimeLatest *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntime090 *server.GetServerOutputOptions - - // GetServer Output Options with expected error - GetServerOutputOptionsForRuntimeLatestWithError *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime090WithError *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime0280WithError *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime0254WithError *server.GetServerOutputOptions - GetServerOutputOptionsForRuntime0116WithError *server.GetServerOutputOptions - - GetServerTwoOutputOptionsForRuntimeLatestWithError *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntime090WithError *server.GetServerOutputOptions - GetServerTwoOutputOptionsForRuntime0280WithError *server.GetServerOutputOptions - - // GetCurrentServer Input Options - GetCurrentServerInputOptionsForRuntime0116 *server.GetCurrentServerInputOptions - GetCurrentServerInputOptionsForRuntime0254 *server.GetCurrentServerInputOptions - GetCurrentServerInputOptionsForRuntime0280 *server.GetCurrentServerInputOptions - GetCurrentServerInputOptionsForRuntimeLatest *server.GetCurrentServerInputOptions - GetCurrentServerInputOptionsForRuntime090 *server.GetCurrentServerInputOptions - - // GetCurrentServer Output Options - GetCurrentServerOutputOptionsForRuntime0116 *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime0254 *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime0280 *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime090 *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntimeLatest *server.GetCurrentServerOutputOptions - - // GetCurrentServer Output Options with expected error - GetCurrentServerOutputOptionsForRuntimeLatestWithError *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime090WithError *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime0280WithError *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime0254WithError *server.GetCurrentServerOutputOptions - GetCurrentServerOutputOptionsForRuntime0116WithError *server.GetCurrentServerOutputOptions - - // DeleteServer Input Options - DeleteServerInputOptionsForRuntime0254 *server.DeleteServerInputOptions - DeleteServerInputOptionsForRuntime0280 *server.DeleteServerInputOptions - DeleteServerInputOptionsForRuntime090 *server.DeleteServerInputOptions - DeleteServerInputOptionsForRuntimeLatest *server.DeleteServerInputOptions - DeleteServerInputOptionsForRuntime0116 *server.DeleteServerInputOptions - - // DeleteServer Output Options with expected error - DeleteServerOutputOptionsForRuntime0280WithError *server.DeleteServerOutputOptions - DeleteServerOutputOptionsForRuntimeLatestWithError *server.DeleteServerOutputOptions - DeleteServerOutputOptionsForRuntime090WithError *server.DeleteServerOutputOptions - - // RemoveCurrentServer Input Options - RemoveCurrentServerInputOptionsForRuntime0280 *server.RemoveCurrentServerInputOptions - RemoveCurrentServerInputOptionsForRuntimeLatest *server.RemoveCurrentServerInputOptions - RemoveCurrentServerInputOptionsForRuntime090 *server.RemoveCurrentServerInputOptions - - // RemoveCurrentServer Output Options with expected error - RemoveCurrentServerOutputOptionsForRuntimeLatestWithError *server.RemoveCurrentServerOutputOptions - RemoveCurrentServerOutputOptionsForRuntime090WithError *server.RemoveCurrentServerOutputOptions - RemoveCurrentServerOutputOptionsForRuntime0280WithError *server.RemoveCurrentServerOutputOptions - - // Server API Commands - // SetServer API Commands - SetServerCmdForRuntimeLatest *core.Command - SetServerCmdForRuntime090 *core.Command - SetServerCmdForRuntime0280 *core.Command - SetServerCmdForRuntime0254 *core.Command - SetServerCmdForRuntime0116 *core.Command - - SetServerTwoCmdForRuntimeLatest *core.Command - SetServerTwoCmdForRuntime090 *core.Command - SetServerTwoCmdForRuntime0280 *core.Command - SetServerTwoCmdForRuntime0254 *core.Command - SetServerTwoCmdForRuntime0116 *core.Command - - // SetCurrentServer API Commands - SetCurrentServerCmdForRuntime0116 *core.Command - SetCurrentServerCmdForRuntime0254 *core.Command - SetCurrentServerCmdForRuntime0280 *core.Command - SetCurrentServerCmdForRuntime090 *core.Command - SetCurrentServerCmdForRuntimeLatest *core.Command - - // GetServer API Commands - GetServerCmdForRuntimeLatest *core.Command - GetServerCmdForRuntime090 *core.Command - GetServerCmdForRuntime0280 *core.Command - GetServerCmdForRuntime0254 *core.Command - GetServerCmdForRuntime0116 *core.Command - - GetServerTwoCmdForRuntimeLatest *core.Command - GetServerTwoCmdForRuntime090 *core.Command - GetServerTwoCmdForRuntime0280 *core.Command - GetServerTwoCmdForRuntime0254 *core.Command - GetServerTwoCmdForRuntime0116 *core.Command - - GetServerCmdForRuntimeLatestWithError *core.Command - GetServerCmdForRuntime090WithError *core.Command - GetServerCmdForRuntime0280WithError *core.Command - GetServerCmdForRuntime0254WithError *core.Command - GetServerCmdForRuntime0116WithError *core.Command - - GetServerTwoCmdForRuntimeLatestWithError *core.Command - GetServerTwoCmdForRuntime090WithError *core.Command - GetServerTwoCmdForRuntime0280WithError *core.Command - - // GetCurrentServer API Commands - GetCurrentServerCmdForRuntimeLatest *core.Command - GetCurrentServerCmdForRuntime090 *core.Command - GetCurrentServerCmdForRuntime0280 *core.Command - GetCurrentServerCmdForRuntime0254 *core.Command - GetCurrentServerCmdForRuntime0116 *core.Command - - GetCurrentServerCmdForRuntimeLatestWithError *core.Command - GetCurrentServerCmdForRuntime090WithError *core.Command - GetCurrentServerCmdForRuntime0280WithError *core.Command - GetCurrentServerCmdForRuntime0254WithError *core.Command - GetCurrentServerCmdForRuntime0116WithError *core.Command - - // DeleteServer API Commands - DeleteServerCmdForRuntime0116 *core.Command - DeleteServerCmdForRuntime0280 *core.Command - DeleteServerCmdForRuntime0254 *core.Command - DeleteServerCmdForRuntime090 *core.Command - DeleteServerCmdForRuntimeLatest *core.Command - - DeleteServerCmdForRuntime0280WithError *core.Command - DeleteServerCmdForRuntime090WithError *core.Command - DeleteServerCmdForRuntimeLatestWithError *core.Command - - // RemoveCurrentServer API Commands - RemoveCurrentServerCmdForRuntime0280 *core.Command - RemoveCurrentServerCmdForRuntime090 *core.Command - RemoveCurrentServerCmdForRuntimeLatest *core.Command - - RemoveCurrentServerCmdForRuntimeLatestWithError *core.Command - RemoveCurrentServerCmdForRuntime090WithError *core.Command - RemoveCurrentServerCmdForRuntime0280WithError *core.Command -} - -// SetUpDefaultData sets up the Helper struct with default input/output options and api commands -func (b *Helper) SetUpDefaultData() { - ginkgo.By("Setup Input and Output Options for Servers APIs") - b.SetupSetServerTestInputAndOutputOptions() - b.CreateSetServerAPICommands() - - b.SetupSetCurrentServerTestInputAndOutputOptions() - b.CreateSetCurrentServerAPICommands() - - b.SetupGetCurrentServerTestInputAndOutputOptions() - b.CreateGetCurrentServerAPICommands() - - b.SetupGetServerTestInputAndOutputOptions() - b.CreateGetServerAPICommands() - - b.SetupDeleteServerTestInputAndOutputOptions() - b.CreateDeleteServerAPICommands() - - b.SetupRemoveCurrentServerTestInputAndOutputOptions() - b.CreateRemoveCurrentServerAPICommands() -} - -// SetupRemoveCurrentServerTestInputAndOutputOptions sets input and output options and api commands for RemoveCurrentServer API -func (b *Helper) SetupRemoveCurrentServerTestInputAndOutputOptions() { - // Input and Output Options for RemoveCurrentServer - ginkgo.By("Setup Input and Output Options for RemoveCurrentServer") - - b.RemoveCurrentServerInputOptionsForRuntime0280 = DefaultRemoveCurrentServerInputOptions(core.Version0280) - b.RemoveCurrentServerInputOptionsForRuntimeLatest = DefaultRemoveCurrentServerInputOptions(core.VersionLatest) - b.RemoveCurrentServerInputOptionsForRuntime090 = DefaultRemoveCurrentServerInputOptions(core.Version090) - - b.RemoveCurrentServerOutputOptionsForRuntime090WithError = DefaultRemoveCurrentServerOutputOptionsWithError(core.Version090, common.CompatibilityTestOne) - b.RemoveCurrentServerOutputOptionsForRuntimeLatestWithError = DefaultRemoveCurrentServerOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestOne) - b.RemoveCurrentServerOutputOptionsForRuntime0280WithError = DefaultRemoveCurrentServerOutputOptionsWithError(core.Version0280, common.CompatibilityTestOne) -} - -// CreateRemoveCurrentServerAPICommands sets api commands for RemoveCurrentServer API -func (b *Helper) CreateRemoveCurrentServerAPICommands() { - // Create RemoveCurrentServer Commands with input and output options - ginkgo.By("Create RemoveCurrentServer API Commands") - - removeCurrentServerCmdForRuntime0280, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntime0280 = removeCurrentServerCmdForRuntime0280 - - removeCurrentServerCmdForRuntimeLatest, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntimeLatest = removeCurrentServerCmdForRuntimeLatest - - removeCurrentServerCmdForRuntime090, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntime090 = removeCurrentServerCmdForRuntime090 - - removeCurrentServerCmdForRuntimeLatestWithError, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntimeLatest, b.RemoveCurrentServerOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntimeLatestWithError = removeCurrentServerCmdForRuntimeLatestWithError - - removeCurrentServerCmdForRuntime090WithError, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntime090, b.RemoveCurrentServerOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntime090WithError = removeCurrentServerCmdForRuntime090WithError - - removeCurrentServerCmdForRuntime0280WithError, err := server.NewRemoveCurrentServerCommand(b.RemoveCurrentServerInputOptionsForRuntime0280, b.RemoveCurrentServerOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.RemoveCurrentServerCmdForRuntime0280WithError = removeCurrentServerCmdForRuntime0280WithError -} - -// SetupDeleteServerTestInputAndOutputOptions sets api commands for DeleteServer API -func (b *Helper) SetupDeleteServerTestInputAndOutputOptions() { - // Input and Output Options for DeleteServer - ginkgo.By("Setup Input and Output Options for DeleteServer") - - b.DeleteServerInputOptionsForRuntime0116 = DefaultDeleteServerInputOptions(core.Version0116, common.CompatibilityTestOne) - b.DeleteServerInputOptionsForRuntime0280 = DefaultDeleteServerInputOptions(core.Version0280, common.CompatibilityTestOne) - b.DeleteServerInputOptionsForRuntime0254 = DefaultDeleteServerInputOptions(core.Version0254, common.CompatibilityTestOne) - b.DeleteServerInputOptionsForRuntime090 = DefaultDeleteServerInputOptions(core.Version090, common.CompatibilityTestOne) - b.DeleteServerInputOptionsForRuntimeLatest = DefaultDeleteServerInputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.DeleteServerOutputOptionsForRuntime0280WithError = DefaultDeleteServerOutputOptionsWithError(core.Version0280, common.CompatibilityTestOne) - b.DeleteServerOutputOptionsForRuntimeLatestWithError = DefaultDeleteServerOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestOne) - b.DeleteServerOutputOptionsForRuntime090WithError = DefaultDeleteServerOutputOptionsWithError(core.Version090, common.CompatibilityTestOne) -} - -// CreateDeleteServerAPICommands sets api commands for DeleteServer API -func (b *Helper) CreateDeleteServerAPICommands() { - // Create DeleteServer Commands with input and output options - ginkgo.By("Create DeleteServer API Commands") - - deleteServerCmdForRuntimeLatest, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntimeLatest = deleteServerCmdForRuntimeLatest - - deleteServerCmdForRuntime090, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime090 = deleteServerCmdForRuntime090 - - deleteServerCmdForRuntime0280, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime0280 = deleteServerCmdForRuntime0280 - - deleteServerCmdForRuntime0254, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime0254 = deleteServerCmdForRuntime0254 - - deleteServerCmdForRuntime0116, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime0116, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime0116 = deleteServerCmdForRuntime0116 - - deleteServerCmdForRuntime0280WithError, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime0280, b.DeleteServerOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime0280WithError = deleteServerCmdForRuntime0280WithError - - deleteServerCmdForRuntimeLatestWithError, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntimeLatest, b.DeleteServerOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntimeLatestWithError = deleteServerCmdForRuntimeLatestWithError - - deleteServerCmdForRuntime090WithError, err := server.NewDeleteServerCommand(b.DeleteServerInputOptionsForRuntime090, b.DeleteServerOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.DeleteServerCmdForRuntime090WithError = deleteServerCmdForRuntime090WithError -} - -// SetupGetServerTestInputAndOutputOptions sets input and output options for GetServer API -func (b *Helper) SetupGetServerTestInputAndOutputOptions() { - // Input and Output params for GetServer - ginkgo.By("Setup Input and Output Options for GetServer") - - b.GetServerInputOptionsForRuntimeLatest = DefaultGetServerInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.GetServerInputOptionsForRuntime090 = DefaultGetServerInputOptions(core.Version090, common.CompatibilityTestOne) - - b.GetServerInputOptionsForRuntime0280 = DefaultGetServerInputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetServerInputOptionsForRuntime0254 = DefaultGetServerInputOptions(core.Version0254, common.CompatibilityTestOne) - b.GetServerInputOptionsForRuntime0116 = DefaultGetServerInputOptions(core.Version0116, common.CompatibilityTestOne) - - b.GetServerTwoInputOptionsForRuntimeLatest = DefaultGetServerInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.GetServerTwoInputOptionsForRuntime090 = DefaultGetServerInputOptions(core.Version090, common.CompatibilityTestTwo) - - b.GetServerTwoInputOptionsForRuntime0280 = DefaultGetServerInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.GetServerTwoInputOptionsForRuntime0254 = DefaultGetServerInputOptions(core.Version0254, common.CompatibilityTestTwo) - b.GetServerTwoInputOptionsForRuntime0116 = DefaultGetServerInputOptions(core.Version0116, common.CompatibilityTestTwo) - - b.GetServerOutputOptionsForRuntime0280 = DefaultGetServerOutputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntime0254 = DefaultGetServerOutputOptions(core.Version0254, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntimeLatest = DefaultGetServerOutputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntime090 = DefaultGetServerOutputOptions(core.Version090, common.CompatibilityTestOne) - - b.GetServerOutputOptionsForRuntime0116 = DefaultGetServerOutputOptions(core.Version0116, common.CompatibilityTestOne) - - b.GetServerTwoOutputOptionsForRuntimeLatest = DefaultGetServerOutputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.GetServerTwoOutputOptionsForRuntime090 = DefaultGetServerOutputOptions(core.Version090, common.CompatibilityTestTwo) - - b.GetServerTwoOutputOptionsForRuntime0280 = DefaultGetServerOutputOptions(core.Version0280, common.CompatibilityTestTwo) - b.GetServerTwoOutputOptionsForRuntime0254 = DefaultGetServerOutputOptions(core.Version0254, common.CompatibilityTestTwo) - b.GetServerTwoOutputOptionsForRuntime0116 = DefaultGetServerOutputOptions(core.Version0116, common.CompatibilityTestTwo) - - b.GetServerOutputOptionsForRuntimeLatestWithError = DefaultGetServerOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntime090WithError = DefaultGetServerOutputOptionsWithError(core.Version090, common.CompatibilityTestOne) - - b.GetServerOutputOptionsForRuntime0280WithError = DefaultGetServerOutputOptionsWithError(core.Version0280, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntime0254WithError = DefaultGetServerOutputOptionsWithError(core.Version0254, common.CompatibilityTestOne) - b.GetServerOutputOptionsForRuntime0116WithError = DefaultGetServerOutputOptionsWithError(core.Version0116, common.CompatibilityTestOne) - - b.GetServerTwoOutputOptionsForRuntimeLatestWithError = DefaultGetServerOutputOptionsWithError(core.VersionLatest, common.CompatibilityTestTwo) - b.GetServerTwoOutputOptionsForRuntime090WithError = DefaultGetServerOutputOptionsWithError(core.Version090, common.CompatibilityTestTwo) - - b.GetServerTwoOutputOptionsForRuntime0280WithError = DefaultGetServerOutputOptionsWithError(core.Version0280, common.CompatibilityTestTwo) -} - -// CreateGetServerAPICommands sets api commands for GetServer API -// -//nolint:funlen -func (b *Helper) CreateGetServerAPICommands() { - // Create GetServer Commands with input and output options - ginkgo.By("Create GetServer API Commands") - - getServerCmdForRuntimeLatest, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntimeLatest, b.GetServerOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntimeLatest = getServerCmdForRuntimeLatest - - getServerCmdForRuntime090, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime090, b.GetServerOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime090 = getServerCmdForRuntime090 - - getServerCmdForRuntime0280, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0280, b.GetServerOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0280 = getServerCmdForRuntime0280 - - getServerCmdForRuntime0254, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0254, b.GetServerOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0254 = getServerCmdForRuntime0254 - - getServerCmdForRuntime0116, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0116, b.GetServerOutputOptionsForRuntime0116) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0116 = getServerCmdForRuntime0116 - - getServerTwoCmdForRuntimeLatest, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntimeLatest, b.GetServerTwoOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntimeLatest = getServerTwoCmdForRuntimeLatest - - getServerTwoCmdForRuntime090, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime090, b.GetServerTwoOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime090 = getServerTwoCmdForRuntime090 - - getServerTwoCmdForRuntime0280, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime0280, b.GetServerTwoOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime0280 = getServerTwoCmdForRuntime0280 - - getServerTwoCmdForRuntime0254, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime0254, b.GetServerTwoOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime0254 = getServerTwoCmdForRuntime0254 - - getServerTwoCmdForRuntime0116, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime0116, b.GetServerTwoOutputOptionsForRuntime0116) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime0116 = getServerTwoCmdForRuntime0116 - - getServerCmdForRuntimeLatestWithError, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntimeLatest, b.GetServerOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntimeLatestWithError = getServerCmdForRuntimeLatestWithError - - getServerCmdForRuntime090WithError, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime090, b.GetServerOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime090WithError = getServerCmdForRuntime090WithError - - getServerCmdForRuntime0280WithError, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0280, b.GetServerOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0280WithError = getServerCmdForRuntime0280WithError - - getServerCmdForRuntime0254WithError, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0254, b.GetServerOutputOptionsForRuntime0254WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0254WithError = getServerCmdForRuntime0254WithError - - getServerCmdForRuntime0116WithError, err := server.NewGetServerCommand(b.GetServerInputOptionsForRuntime0116, b.GetServerOutputOptionsForRuntime0116WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerCmdForRuntime0116WithError = getServerCmdForRuntime0116WithError - - getServerTwoCmdForRuntimeLatestWithError, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntimeLatest, b.GetServerTwoOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntimeLatestWithError = getServerTwoCmdForRuntimeLatestWithError - - getServerTwoCmdForRuntime090WithError, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime090, b.GetServerTwoOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime090WithError = getServerTwoCmdForRuntime090WithError - - getServerTwoCmdForRuntime0280WithError, err := server.NewGetServerCommand(b.GetServerTwoInputOptionsForRuntime0280, b.GetServerTwoOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetServerTwoCmdForRuntime0280WithError = getServerTwoCmdForRuntime0280WithError -} - -// SetupGetCurrentServerTestInputAndOutputOptions sets input and output options for GetCurrentServer API -func (b *Helper) SetupGetCurrentServerTestInputAndOutputOptions() { - // Input and Output Parameters for GetCurrentServer - ginkgo.By("Setup Input and Output Options for GetCurrentServer") - - b.GetCurrentServerInputOptionsForRuntimeLatest = DefaultGetCurrentServerInputOptions(core.VersionLatest) - - b.GetCurrentServerInputOptionsForRuntime090 = DefaultGetCurrentServerInputOptions(core.Version090) - - b.GetCurrentServerInputOptionsForRuntime0280 = DefaultGetCurrentServerInputOptions(core.Version0280) - b.GetCurrentServerInputOptionsForRuntime0254 = DefaultGetCurrentServerInputOptions(core.Version0254) - b.GetCurrentServerInputOptionsForRuntime0116 = DefaultGetCurrentServerInputOptions(core.Version0116) - - b.GetCurrentServerOutputOptionsForRuntime0280 = DefaultGetCurrentServerOutputOptions(core.Version0280, common.CompatibilityTestOne) - b.GetCurrentServerOutputOptionsForRuntime0254 = DefaultGetCurrentServerOutputOptions(core.Version0254, common.CompatibilityTestOne) - b.GetCurrentServerOutputOptionsForRuntimeLatest = DefaultGetCurrentServerOutputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.GetCurrentServerOutputOptionsForRuntime090 = DefaultGetCurrentServerOutputOptions(core.Version090, common.CompatibilityTestOne) - - b.GetCurrentServerOutputOptionsForRuntime0116 = DefaultGetCurrentServerOutputOptions(core.Version0116, common.CompatibilityTestOne) - - b.GetCurrentServerOutputOptionsForRuntimeLatestWithError = DefaultGetCurrentServerOutputOptionsWithError(core.VersionLatest) - b.GetCurrentServerOutputOptionsForRuntime090WithError = DefaultGetCurrentServerOutputOptionsWithError(core.Version090) - - b.GetCurrentServerOutputOptionsForRuntime0280WithError = DefaultGetCurrentServerOutputOptionsWithError(core.Version0280) - b.GetCurrentServerOutputOptionsForRuntime0254WithError = DefaultGetCurrentServerOutputOptionsWithError(core.Version0254) - b.GetCurrentServerOutputOptionsForRuntime0116WithError = DefaultGetCurrentServerOutputOptionsWithError(core.Version0116) -} - -// CreateGetCurrentServerAPICommands sets api commands for GetCurrentServer API -func (b *Helper) CreateGetCurrentServerAPICommands() { - // Create GetCurrentServer Commands with input and output options - ginkgo.By("Create GetCurrentServer API Commands") - - getCurrentServerCmdForRuntimeLatest, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntimeLatest, b.GetCurrentServerOutputOptionsForRuntimeLatest) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntimeLatest = getCurrentServerCmdForRuntimeLatest - - getCurrentServerCmdForRuntime090, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime090, b.GetCurrentServerOutputOptionsForRuntime090) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime090 = getCurrentServerCmdForRuntime090 - - getCurrentServerCmdForRuntime0280, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0280, b.GetCurrentServerOutputOptionsForRuntime0280) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0280 = getCurrentServerCmdForRuntime0280 - - getCurrentServerCmdForRuntime0254, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0254, b.GetCurrentServerOutputOptionsForRuntime0254) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0254 = getCurrentServerCmdForRuntime0254 - - getCurrentServerCmdForRuntime0116, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0116, b.GetCurrentServerOutputOptionsForRuntime0116) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0116 = getCurrentServerCmdForRuntime0116 - - getCurrentServerCmdForRuntimeLatestWithError, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntimeLatest, b.GetCurrentServerOutputOptionsForRuntimeLatestWithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntimeLatestWithError = getCurrentServerCmdForRuntimeLatestWithError - - getCurrentServerCmdForRuntime090WithError, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime090, b.GetCurrentServerOutputOptionsForRuntime090WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime090WithError = getCurrentServerCmdForRuntime090WithError - - getCurrentServerCmdForRuntime0280WithError, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0280, b.GetCurrentServerOutputOptionsForRuntime0280WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0280WithError = getCurrentServerCmdForRuntime0280WithError - - getCurrentServerCmdForRuntime0254WithError, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0254, b.GetCurrentServerOutputOptionsForRuntime0254WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0254WithError = getCurrentServerCmdForRuntime0254WithError - - getCurrentServerCmdForRuntime0116WithError, err := server.NewGetCurrentServerCommand(b.GetCurrentServerInputOptionsForRuntime0116, b.GetCurrentServerOutputOptionsForRuntime0116WithError) - gomega.Expect(err).To(gomega.BeNil()) - b.GetCurrentServerCmdForRuntime0116WithError = getCurrentServerCmdForRuntime0116WithError -} - -// SetupSetCurrentServerTestInputAndOutputOptions sets input and output options for SetCurrentServer API -func (b *Helper) SetupSetCurrentServerTestInputAndOutputOptions() { - // Input and Output Parameters for SetCurrentServer - ginkgo.By("Setup Input and Output Options for SetCurrentServer") - - b.SetCurrentServerInputOptionsForRuntimeLatest = DefaultSetCurrentServerInputOptions(core.VersionLatest, common.CompatibilityTestOne) - b.SetCurrentServerInputOptionsForRuntime090 = DefaultSetCurrentServerInputOptions(core.Version090, common.CompatibilityTestOne) - - b.SetCurrentServerInputOptionsForRuntime0280 = DefaultSetCurrentServerInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetCurrentServerInputOptionsForRuntime0254 = DefaultSetCurrentServerInputOptions(core.Version0254, common.CompatibilityTestOne) - b.SetCurrentServerInputOptionsForRuntime0116 = DefaultSetCurrentServerInputOptions(core.Version0116, common.CompatibilityTestOne) -} - -// CreateSetCurrentServerAPICommands sets api commands for SetCurrentServer API -func (b *Helper) CreateSetCurrentServerAPICommands() { - // Create SetCurrentServer Commands with input and output options - ginkgo.By("Create SetCurrentServer API Commands") - - setCurrentServerCmdForRuntimeLatest, err := server.NewSetCurrentServerCommand(b.SetCurrentServerInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentServerCmdForRuntimeLatest = setCurrentServerCmdForRuntimeLatest - - setCurrentServerCmdForRuntime090, err := server.NewSetCurrentServerCommand(b.SetCurrentServerInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentServerCmdForRuntime090 = setCurrentServerCmdForRuntime090 - - setCurrentServerCmdForRuntime0280, err := server.NewSetCurrentServerCommand(b.SetCurrentServerInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentServerCmdForRuntime0280 = setCurrentServerCmdForRuntime0280 - - setCurrentServerCmdForRuntime0254, err := server.NewSetCurrentServerCommand(b.SetCurrentServerInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentServerCmdForRuntime0254 = setCurrentServerCmdForRuntime0254 - - setCurrentServerCmdForRuntime0116, err := server.NewSetCurrentServerCommand(b.SetCurrentServerInputOptionsForRuntime0116, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetCurrentServerCmdForRuntime0116 = setCurrentServerCmdForRuntime0116 -} - -// SetupSetServerTestInputAndOutputOptions sets input and output options for SetServer API -func (b *Helper) SetupSetServerTestInputAndOutputOptions() { - // Input and Output Parameters for SetServer - ginkgo.By("Setup Input and Output Options for SetServer") - - b.SetServerInputOptionsForRuntimeLatest = DefaultSetServerInputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.SetServerInputOptionsForRuntime090 = DefaultSetServerInputOptions(core.Version090, common.CompatibilityTestOne) - - b.SetServerInputOptionsForRuntime0280 = DefaultSetServerInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetServerInputOptionsForRuntime0254 = DefaultSetServerInputOptions(core.Version0254, common.CompatibilityTestOne) - b.SetServerInputOptionsForRuntime0116 = DefaultSetServerInputOptions(core.Version0116, common.CompatibilityTestOne) - - b.SetServerTwoInputOptionsForRuntimeLatest = DefaultSetServerInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - - b.SetServerTwoInputOptionsForRuntime090 = DefaultSetServerInputOptions(core.Version090, common.CompatibilityTestTwo) - - b.SetServerTwoInputOptionsForRuntime0280 = DefaultSetServerInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.SetServerTwoInputOptionsForRuntime0254 = DefaultSetServerInputOptions(core.Version0254, common.CompatibilityTestTwo) - b.SetServerTwoInputOptionsForRuntime0116 = DefaultSetServerInputOptions(core.Version0116, common.CompatibilityTestTwo) - - // Input and Output Parameters for SetServer - b.SetServerInputOptionsForRuntimeLatest = DefaultSetServerInputOptions(core.VersionLatest, common.CompatibilityTestOne) - - b.SetServerInputOptionsForRuntime090 = DefaultSetServerInputOptions(core.Version090, common.CompatibilityTestOne) - - b.SetServerInputOptionsForRuntime0280 = DefaultSetServerInputOptions(core.Version0280, common.CompatibilityTestOne) - b.SetServerInputOptionsForRuntime0254 = DefaultSetServerInputOptions(core.Version0254, common.CompatibilityTestOne) - b.SetServerInputOptionsForRuntime0116 = DefaultSetServerInputOptions(core.Version0116, common.CompatibilityTestOne) - - b.SetServerTwoInputOptionsForRuntimeLatest = DefaultSetServerInputOptions(core.VersionLatest, common.CompatibilityTestTwo) - b.SetServerTwoInputOptionsForRuntime090 = DefaultSetServerInputOptions(core.Version090, common.CompatibilityTestTwo) - - b.SetServerTwoInputOptionsForRuntime0280 = DefaultSetServerInputOptions(core.Version0280, common.CompatibilityTestTwo) - b.SetServerTwoInputOptionsForRuntime0254 = DefaultSetServerInputOptions(core.Version0254, common.CompatibilityTestTwo) - b.SetServerTwoInputOptionsForRuntime0116 = DefaultSetServerInputOptions(core.Version0116, common.CompatibilityTestTwo) - - b.CreateSetServerAPICommands() -} - -// CreateSetServerAPICommands sets api commands for SetServer API -func (b *Helper) CreateSetServerAPICommands() { - // Create SetServer Commands with input and output options - ginkgo.By("Create SetServer API Commands") - - setServerCmdForRuntimeLatest, err := server.NewSetServerCommand(b.SetServerInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerCmdForRuntimeLatest = setServerCmdForRuntimeLatest - - setServerCmdForRuntime090, err := server.NewSetServerCommand(b.SetServerInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerCmdForRuntime090 = setServerCmdForRuntime090 - - setServerCmdForRuntime0254, err := server.NewSetServerCommand(b.SetServerInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerCmdForRuntime0254 = setServerCmdForRuntime0254 - - setServerCmdForRuntime0280, err := server.NewSetServerCommand(b.SetServerInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerCmdForRuntime0280 = setServerCmdForRuntime0280 - - setServerCmdForRuntime0116, err := server.NewSetServerCommand(b.SetServerInputOptionsForRuntime0116, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerCmdForRuntime0116 = setServerCmdForRuntime0116 - - setServerTwoCmdForRuntimeLatest, err := server.NewSetServerCommand(b.SetServerTwoInputOptionsForRuntimeLatest, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerTwoCmdForRuntimeLatest = setServerTwoCmdForRuntimeLatest - - setServerTwoCmdForRuntime090, err := server.NewSetServerCommand(b.SetServerTwoInputOptionsForRuntime090, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerTwoCmdForRuntime090 = setServerTwoCmdForRuntime090 - - setServerTwoCmdForRuntime0254, err := server.NewSetServerCommand(b.SetServerTwoInputOptionsForRuntime0254, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerTwoCmdForRuntime0254 = setServerTwoCmdForRuntime0254 - - setServerTwoCmdForRuntime0280, err := server.NewSetServerCommand(b.SetServerTwoInputOptionsForRuntime0280, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerTwoCmdForRuntime0280 = setServerTwoCmdForRuntime0280 - - setServerTwoCmdForRuntime0116, err := server.NewSetServerCommand(b.SetServerTwoInputOptionsForRuntime0116, nil) - gomega.Expect(err).To(gomega.BeNil()) - b.SetServerTwoCmdForRuntime0116 = setServerTwoCmdForRuntime0116 -} - -// DefaultSetServerInputOptions helper method to construct SetServer API input options -func DefaultSetServerInputOptions(version core.RuntimeVersion, serverName string) *server.SetServerInputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.SetServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerOpts: &types.ServerOpts{ - Name: serverName, - Type: types.ManagementClusterServerType, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - } - } - - return nil -} - -// DefaultGetServerInputOptions helper method to construct GetServer API input options -func DefaultGetServerInputOptions(version core.RuntimeVersion, serverName string) *server.GetServerInputOptions { - return &server.GetServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerName: serverName, - } -} - -// DefaultGetServerOutputOptions helper method to construct GetServer API output options -func DefaultGetServerOutputOptions(version core.RuntimeVersion, serverName string) *server.GetServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &server.GetServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerOpts: &types.ServerOpts{ - Name: serverName, - Type: types.ManagementClusterServerType, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version0254, core.Version0116: - return &server.GetServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerOpts: &types.ServerOpts{ - Name: serverName, - Type: types.ManagementClusterServerType, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - } - } - return nil -} - -// DefaultGetServerOutputOptionsWithError helper method to construct GetServer API output options with error -func DefaultGetServerOutputOptionsWithError(version core.RuntimeVersion, serverName string) *server.GetServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.GetServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.VersionLatest, - }, - Error: fmt.Sprintf("could not find server \"%v\"", serverName), - } - } - return nil -} - -// DefaultSetCurrentServerInputOptions helper method to construct SetCurrentServer API input options -func DefaultSetCurrentServerInputOptions(version core.RuntimeVersion, serverName string) *server.SetCurrentServerInputOptions { - return &server.SetCurrentServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerName: serverName, - } -} - -// DefaultGetCurrentServerInputOptions helper method to construct GetCurrentServer API input options -func DefaultGetCurrentServerInputOptions(version core.RuntimeVersion) *server.GetCurrentServerInputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.GetCurrentServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.VersionLatest, - }, - } - } - return nil -} - -// DefaultGetCurrentServerOutputOptions helper method to construct GetCurrentServer API output options -func DefaultGetCurrentServerOutputOptions(version core.RuntimeVersion, serverName string) *server.GetCurrentServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0254, core.Version0116: - return &server.GetCurrentServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerOpts: &types.ServerOpts{ - Name: serverName, - Type: types.ManagementClusterServerType, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - case core.Version0280: - return &server.GetCurrentServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: core.Version0280, - }, - ServerOpts: &types.ServerOpts{ - Name: serverName, - Type: types.ManagementClusterServerType, - GlobalOpts: &types.GlobalServerOpts{ - Endpoint: common.DefaultEndpoint, - }, - }, - ValidationStrategy: core.ValidationStrategyStrict, - } - } - return nil -} - -// DefaultGetCurrentServerOutputOptionsWithError helper method to construct GetCurrentServer API output options with error -func DefaultGetCurrentServerOutputOptionsWithError(version core.RuntimeVersion) *server.GetCurrentServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.GetCurrentServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: ServerNotFound, - } - } - return nil -} - -// DefaultRemoveCurrentServerInputOptions helper method to construct RemoveCurrentServer API input options -func DefaultRemoveCurrentServerInputOptions(version core.RuntimeVersion) *server.RemoveCurrentServerInputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280: - return &server.RemoveCurrentServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerName: common.CompatibilityTestOne, - } - } - return nil -} - -// DefaultRemoveCurrentServerOutputOptionsWithError helper method to construct RemoveCurrentServer API output option -func DefaultRemoveCurrentServerOutputOptionsWithError(version core.RuntimeVersion, serverName string) *server.RemoveCurrentServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.RemoveCurrentServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("context %v not found", serverName), - } - } - return nil -} - -// DefaultDeleteServerInputOptions helper method to construct DeleteServer API input options -func DefaultDeleteServerInputOptions(version core.RuntimeVersion, serverName string) *server.DeleteServerInputOptions { - return &server.DeleteServerInputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - ServerName: serverName, - } -} - -// DefaultDeleteServerOutputOptionsWithError helper method to construct DeleteServer API output options -func DefaultDeleteServerOutputOptionsWithError(version core.RuntimeVersion, serverName string) *server.DeleteServerOutputOptions { - switch version { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: - return &server.DeleteServerOutputOptions{ - RuntimeAPIVersion: &core.RuntimeAPIVersion{ - RuntimeVersion: version, - }, - Error: fmt.Sprintf("context %v not found", serverName), - } - } - return nil -} diff --git a/test/compatibility/framework/context/context_helpers.go b/test/compatibility/framework/context/context_helpers.go new file mode 100644 index 000000000..f39e59815 --- /dev/null +++ b/test/compatibility/framework/context/context_helpers.go @@ -0,0 +1,375 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Package context contains all the cross version api compatibility tests for context apis +package context + +import ( + "fmt" + + "github.com/onsi/gomega" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/types" +) + +func SetContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + var inputOpts *SetContextInputOptions + var outputOpts *SetContextOutputOptions + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest: + inputOpts = &SetContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + ContextType: types.ContextTypeK8s, + GlobalOpts: args.GlobalOpts, + }, + } + case core.Version102, core.Version090, core.Version0280: + inputOpts = &SetContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + GlobalOpts: args.GlobalOpts, + }, + } + case core.Version0254: + inputOpts = &SetContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + + cmd, err := NewSetContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func GetContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + Error: false, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &GetContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextName: args.ContextName, + } + + var outputOpts *GetContextOutputOptions + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest: + if args.Error { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("context %v not found", args.ContextName), + } + } else { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + ContextType: types.ContextTypeK8s, + GlobalOpts: args.GlobalOpts, + }, + ValidationStrategy: core.ValidationStrategyStrict, + } + } + case core.Version102, core.Version090, core.Version0280: + if args.Error { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("context %v not found", args.ContextName), + } + } else { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + GlobalOpts: args.GlobalOpts, + }, + ValidationStrategy: core.ValidationStrategyStrict, + } + } + + case core.Version0254: + if args.Error { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("could not find context \"%v\"", args.ContextName), + } + } else { + outputOpts = &GetContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + } + + cmd, err := NewGetContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +//nolint:dupl +func DeleteContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &DeleteContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextName: args.ContextName, + } + + var outputOpts *DeleteContextOutputOptions + + if args.Error { + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: + outputOpts = &DeleteContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("context %v not found", args.ContextName), + } + case core.Version0254: + outputOpts = &DeleteContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("could not find context \"%v\"", args.ContextName), + } + } + } + + cmd, err := NewDeleteContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +//nolint:dupl +func RemoveCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &RemoveCurrentContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Target: args.Target, + } + + var outputOpts *RemoveCurrentContextOutputOptions + + if args.Error { + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: + outputOpts = &RemoveCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("no current context set for target \"%v\"", args.Target), + } + case core.Version0254: + outputOpts = &RemoveCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("no current context set for type \"%v\"", args.Type), + } + } + } + + cmd, err := NewRemoveCurrentContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func GetCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + var inputOpts *GetCurrentContextInputOptions + var outputOpts *GetCurrentContextOutputOptions + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest: + inputOpts = &GetCurrentContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Target: args.Target, + } + if args.Error { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("no current context set for target \"%v\"", args.Target), + } + } else { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + ContextType: types.ContextTypeK8s, + GlobalOpts: args.GlobalOpts, + }, + ValidationStrategy: core.ValidationStrategyStrict, + } + } + case core.Version102, core.Version090, core.Version0280: + inputOpts = &GetCurrentContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Target: args.Target, + } + + if args.Error { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("no current context set for target \"%v\"", args.Target), + } + } else { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Target: args.Target, + GlobalOpts: args.GlobalOpts, + }, + ValidationStrategy: core.ValidationStrategyStrict, + } + } + + case core.Version0254: + inputOpts = &GetCurrentContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextType: args.Type, + } + + if args.Error { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("no current context set for type \"%v\"", args.Type), + } + } else { + outputOpts = &GetCurrentContextOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextOpts: &types.ContextOpts{ + Name: args.ContextName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + } + + cmd, err := NewGetCurrentContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func SetCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command { + args := &CfgContextArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ContextName: common.CompatibilityTestOne, + Target: types.TargetK8s, + Type: types.CtxTypeK8s, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &SetCurrentContextInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ContextName: args.ContextName, + } + + var outputOpts *SetCurrentContextOutputOptions + + cmd, err := NewSetCurrentContextCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} diff --git a/test/compatibility/framework/context/context_options.go b/test/compatibility/framework/context/context_options.go index fcb79845e..6b070f14f 100644 --- a/test/compatibility/framework/context/context_options.go +++ b/test/compatibility/framework/context/context_options.go @@ -8,6 +8,42 @@ import ( "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/types" ) +// CfgContextArgs used to construct input and output options +type CfgContextArgs struct { + RuntimeAPIVersion *core.RuntimeAPIVersion + ContextName string + Target types.Target + Type types.ContextType + SetCurrentContext bool + GlobalOpts *types.GlobalServerOpts + ClusterOpts *types.ClusterServerOpts + DiscoverySources []types.PluginDiscoveryOpts + ValidationStrategy core.ValidationStrategy + Error bool +} + +type CfgContextArgsOption func(*CfgContextArgs) + +func WithContextName(name string) CfgContextArgsOption { + return func(c *CfgContextArgs) { + c.ContextName = name + } +} + +func WithRuntimeVersion(version core.RuntimeVersion) CfgContextArgsOption { + return func(c *CfgContextArgs) { + c.RuntimeAPIVersion = &core.RuntimeAPIVersion{ + RuntimeVersion: version, + } + } +} + +func WithError() CfgContextArgsOption { + return func(c *CfgContextArgs) { + c.Error = true + } +} + // GetContextInputOptions used to generate GetContext command type GetContextInputOptions struct { *core.RuntimeAPIVersion // required diff --git a/test/compatibility/framework/context/context_validators.go b/test/compatibility/framework/context/context_validators.go index 89bb03f5e..2609acdbe 100644 --- a/test/compatibility/framework/context/context_validators.go +++ b/test/compatibility/framework/context/context_validators.go @@ -32,7 +32,7 @@ func (opts *SetContextInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if !opts.ValidName() { return false, fmt.Errorf("invalid 'name' for set context input options for the specified runtime version %v", opts.RuntimeVersion) } @@ -73,6 +73,8 @@ func (opts *GetContextInputOptions) Validate() (bool, error) { } // Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified +// +//nolint:dupl func (opts *GetContextOutputOptions) Validate() (bool, error) { _, err := opts.RuntimeAPIVersion.Validate() if err != nil { @@ -80,7 +82,7 @@ func (opts *GetContextOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if !opts.ShouldNotIncludeContextType() { return false, fmt.Errorf("invalid get context output options for the specified runtime version contextType is not supported %v", opts.RuntimeVersion) } @@ -108,6 +110,8 @@ func (opts *DeleteContextInputOptions) Validate() (bool, error) { } // Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified +// +//nolint:dupl func (opts *GetCurrentContextInputOptions) Validate() (bool, error) { _, err := opts.RuntimeAPIVersion.Validate() if err != nil { @@ -115,7 +119,7 @@ func (opts *GetCurrentContextInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if !opts.ShouldNotIncludeContextType() { return false, fmt.Errorf("invalid get current context input options for the specified runtime version contextType is not supported %v", opts.RuntimeVersion) } @@ -154,7 +158,7 @@ func (opts *GetCurrentContextOutputOptions) Validate() (bool, error) { var valid bool switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: valid = opts.ContextOpts.ShouldNotIncludeContextType() if valid { return valid, nil diff --git a/test/compatibility/framework/envflags/env_validators.go b/test/compatibility/framework/envflags/env_validators.go index 25252d393..8966ec11b 100644 --- a/test/compatibility/framework/envflags/env_validators.go +++ b/test/compatibility/framework/envflags/env_validators.go @@ -18,7 +18,7 @@ func (opts *SetEnvInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for SetEnvInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -39,7 +39,7 @@ func (opts *GetEnvInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for GetEnvInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -57,7 +57,7 @@ func (opts *GetEnvConfigurationsOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: if opts.Envs == nil { return false, fmt.Errorf("invalid 'envs' for GetEnvConfigurationsOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -74,7 +74,7 @@ func (opts *DeleteEnvInputOptions) Validate() (bool, error) { return false, err } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for DeleteEnvInputOptions for the specified runtime version %v", opts.RuntimeVersion) } diff --git a/test/compatibility/framework/featureflags/feature_validators.go b/test/compatibility/framework/featureflags/feature_validators.go index 255b6a6fc..f70d1dea4 100644 --- a/test/compatibility/framework/featureflags/feature_validators.go +++ b/test/compatibility/framework/featureflags/feature_validators.go @@ -18,7 +18,7 @@ func (opts *SetFeatureInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Plugin == "" { return false, fmt.Errorf("invalid 'plugin' for set context input options for the specified runtime version %v", opts.RuntimeVersion) } @@ -42,7 +42,7 @@ func (opts *IsFeatureEnabledInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: if opts.Plugin == "" { return false, fmt.Errorf("invalid 'plugin' for set context input options for the specified runtime version %v", opts.RuntimeVersion) } @@ -62,7 +62,7 @@ func (opts *DeleteFeatureInputOptions) Validate() (bool, error) { return false, err } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Plugin == "" { return false, fmt.Errorf("invalid 'plugin' for set context input options for the specified runtime version %v", opts.RuntimeVersion) } diff --git a/test/compatibility/framework/go.mod b/test/compatibility/framework/go.mod index 4f10d97af..c113e83d0 100644 --- a/test/compatibility/framework/go.mod +++ b/test/compatibility/framework/go.mod @@ -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 @@ -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 @@ -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.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.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 diff --git a/test/compatibility/framework/go.sum b/test/compatibility/framework/go.sum index 6fd877ac1..31dab1ca4 100644 --- a/test/compatibility/framework/go.sum +++ b/test/compatibility/framework/go.sum @@ -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= @@ -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= @@ -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= @@ -60,8 +60,8 @@ 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.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +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= @@ -69,18 +69,18 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h 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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.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.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +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= @@ -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= diff --git a/test/compatibility/framework/legacyclientconfig/legacyclientconfig_options.go b/test/compatibility/framework/legacyclientconfig/legacyclientconfig_options.go index ac47f1b50..b86b55665 100644 --- a/test/compatibility/framework/legacyclientconfig/legacyclientconfig_options.go +++ b/test/compatibility/framework/legacyclientconfig/legacyclientconfig_options.go @@ -51,7 +51,7 @@ type CfgClientConfigArgsOption func(*CfgClientConfigArgs) func WithCLIDiscoverySources(version core.RuntimeVersion, sources []types.PluginDiscoveryOpts) CfgClientConfigArgsOption { return func(c *CfgClientConfigArgs) { switch version { - case core.VersionLatest, core.Version090: + case core.VersionLatest, core.Version102, core.Version090: c.ClientConfigOpts = &types.ClientConfigOpts{ CoreCliOptions: &types.CoreCliOptionsOpts{ DiscoverySources: sources, @@ -74,7 +74,7 @@ func WithDefaultCLIDiscoverySource(version core.RuntimeVersion) CfgClientConfigA defaultPluginDiscoverySource := clidiscoverysources.DefaultCLIDiscoverySourcePerVersion(version) return func(c *CfgClientConfigArgs) { switch version { - case core.VersionLatest, core.Version090: + case core.VersionLatest, core.Version102, core.Version090: c.ClientConfigOpts = &types.ClientConfigOpts{ CoreCliOptions: &types.CoreCliOptionsOpts{ DiscoverySources: []types.PluginDiscoveryOpts{ diff --git a/test/compatibility/framework/metadata/metadata_validators.go b/test/compatibility/framework/metadata/metadata_validators.go index a4790d96d..4794ac511 100644 --- a/test/compatibility/framework/metadata/metadata_validators.go +++ b/test/compatibility/framework/metadata/metadata_validators.go @@ -18,7 +18,7 @@ func (opts *SetConfigMetadataPatchStrategyInputOptions) Validate() (bool, error) } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for SetConfigMetadataPatchStrategyInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -40,7 +40,7 @@ func (opts *SetConfigMetadataSettingInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for SetConfigMetadataSettingInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -61,7 +61,7 @@ func (opts *GetMetadataOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.MetadataOpts != nil && opts.MetadataOpts.ConfigMetadata == nil && opts.MetadataOpts.ConfigMetadata.Settings == nil && opts.MetadataOpts.ConfigMetadata.PatchStrategy == nil { return false, fmt.Errorf("invalid 'key' for GetMetadataOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -79,7 +79,7 @@ func (opts *GetConfigMetadataOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.ConfigMetadataOpts != nil && opts.ConfigMetadataOpts.Settings == nil && opts.ConfigMetadataOpts.PatchStrategy == nil { return false, fmt.Errorf("invalid 'key' for GetConfigMetadataOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -97,7 +97,7 @@ func (opts *GetConfigMetadataPatchStrategyOutputOptions) Validate() (bool, error } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.PatchStrategy == nil { return false, fmt.Errorf("invalid 'key' for GetConfigMetadataPatchStrategyOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -115,7 +115,7 @@ func (opts *GetConfigMetadataSettingsOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.MetadataSettings == nil { return false, fmt.Errorf("invalid 'key' for GetConfigMetadataSettingsOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -133,7 +133,7 @@ func (opts *GetConfigMetadataSettingInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for GetConfigMetadataSettingInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -151,7 +151,7 @@ func (opts *GetConfigMetadataSettingOutputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Value == "" { return false, fmt.Errorf("invalid 'key' for GetConfigMetadataSettingOutputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -169,7 +169,7 @@ func (opts *IsConfigMetadataSettingsEnabledInputOptions) Validate() (bool, error } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for IsConfigMetadataSettingsEnabledInputOptions for the specified runtime version %v", opts.RuntimeVersion) } @@ -186,7 +186,7 @@ func (opts *DeleteConfigMetadataSettingInputOptions) Validate() (bool, error) { return false, err } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: if opts.Key == "" { return false, fmt.Errorf("invalid 'key' for DeleteConfigMetadataSettingInputOptions for the specified runtime version %v", opts.RuntimeVersion) } diff --git a/test/compatibility/framework/server/server_helpers.go b/test/compatibility/framework/server/server_helpers.go new file mode 100644 index 000000000..c0ef2f68c --- /dev/null +++ b/test/compatibility/framework/server/server_helpers.go @@ -0,0 +1,311 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package server + +import ( + "fmt" + + "github.com/onsi/gomega" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/compatibilitytests/common" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/framework/types" +) + +type CfgServerArgs struct { + RuntimeAPIVersion *core.RuntimeAPIVersion + ServerName string // required + Type types.ServerType + SetCurrentServer bool // required + GlobalOpts *types.GlobalServerOpts + ManagementClusterOpts *types.ManagementClusterServerOpts + DiscoverySources []types.PluginDiscoveryOpts + ValidationStrategy core.ValidationStrategy + Error bool +} + +type CfgServerArgsOption func(args *CfgServerArgs) + +func WithServerName(name string) CfgServerArgsOption { + return func(c *CfgServerArgs) { + c.ServerName = name + } +} + +func WithRuntimeVersion(version core.RuntimeVersion) CfgServerArgsOption { + return func(c *CfgServerArgs) { + c.RuntimeAPIVersion = &core.RuntimeAPIVersion{ + RuntimeVersion: version, + } + } +} + +func WithError() CfgServerArgsOption { + return func(c *CfgServerArgs) { + c.Error = true + } +} + +func SetServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + var inputOpts *SetServerInputOptions + var outputOpts *SetServerOutputOptions + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: + inputOpts = &SetServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerOpts: &types.ServerOpts{ + Name: args.ServerName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + + cmd, err := NewSetServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func GetServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + Error: false, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &GetServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerName: args.ServerName, + } + + var outputOpts *GetServerOutputOptions + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280: + if args.Error { + outputOpts = &GetServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("could not find server \"%v\"", args.ServerName), + } + } else { + outputOpts = &GetServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerOpts: &types.ServerOpts{ + Name: args.ServerName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + ValidationStrategy: core.ValidationStrategyStrict, + } + } + + case core.Version0254, core.Version0116: + if args.Error { + outputOpts = &GetServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("could not find server \"%v\"", args.ServerName), + } + } else { + outputOpts = &GetServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerOpts: &types.ServerOpts{ + Name: args.ServerName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + } + + cmd, err := NewGetServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +//nolint:dupl +func DeleteServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &DeleteServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerName: args.ServerName, + } + + var outputOpts *DeleteServerOutputOptions + + if args.Error { + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: + outputOpts = &DeleteServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("context %v not found", args.ServerName), + } + } + } + + cmd, err := NewDeleteServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +//nolint:dupl +func RemoveCurrentServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &RemoveCurrentServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerName: args.ServerName, + } + + var outputOpts *RemoveCurrentServerOutputOptions + + if args.Error { + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: + outputOpts = &RemoveCurrentServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: fmt.Sprintf("context %v not found", args.ServerName), + } + } + } + + cmd, err := NewRemoveCurrentServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func GetCurrentServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + var inputOpts *GetCurrentServerInputOptions + var outputOpts *GetCurrentServerOutputOptions + + inputOpts = &GetCurrentServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + } + + switch args.RuntimeAPIVersion.RuntimeVersion { + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: + if args.Error { + outputOpts = &GetCurrentServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + Error: "current server \"\" not found in tanzu config", + } + } else { + outputOpts = &GetCurrentServerOutputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerOpts: &types.ServerOpts{ + Name: args.ServerName, + Type: args.Type, + GlobalOpts: args.GlobalOpts, + }, + } + } + } + + cmd, err := NewGetCurrentServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} + +func SetCurrentServerCommand(opts ...CfgServerArgsOption) *core.Command { + args := &CfgServerArgs{ + RuntimeAPIVersion: &core.RuntimeAPIVersion{ + RuntimeVersion: core.VersionLatest, + }, + ServerName: common.CompatibilityTestOne, + Type: types.ManagementClusterServerType, + GlobalOpts: &types.GlobalServerOpts{ + Endpoint: common.DefaultEndpoint, + }, + } + + for _, opt := range opts { + opt(args) + } + + inputOpts := &SetCurrentServerInputOptions{ + RuntimeAPIVersion: args.RuntimeAPIVersion, + ServerName: args.ServerName, + } + + var outputOpts *SetCurrentServerOutputOptions + + cmd, err := NewSetCurrentServerCommand(inputOpts, outputOpts) + gomega.Expect(err).To(gomega.BeNil()) + + return cmd +} diff --git a/test/compatibility/framework/server/server_validators.go b/test/compatibility/framework/server/server_validators.go index 8a5f22996..a90e09562 100644 --- a/test/compatibility/framework/server/server_validators.go +++ b/test/compatibility/framework/server/server_validators.go @@ -20,7 +20,7 @@ func (opts *SetServerInputOptions) Validate() (bool, error) { } switch opts.RuntimeVersion { - case core.VersionLatest, core.Version090, core.Version0280, core.Version0254, core.Version0116: + case core.VersionLatest, core.Version102, core.Version090, core.Version0280, core.Version0254, core.Version0116: if !opts.ValidName() { return false, fmt.Errorf("invalid 'name' for set server input options for the specified runtime version %v", opts.RuntimeVersion) } diff --git a/test/compatibility/testplugins/runtime-test-plugin-v0_90/go.mod b/test/compatibility/testplugins/runtime-test-plugin-v0_90/go.mod index 952c28790..b17d3ad82 100644 --- a/test/compatibility/testplugins/runtime-test-plugin-v0_90/go.mod +++ b/test/compatibility/testplugins/runtime-test-plugin-v0_90/go.mod @@ -6,7 +6,6 @@ replace github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core => require ( github.com/spf13/cobra v1.7.0 - // Needs to be replaced by latest release tags github.com/vmware-tanzu/tanzu-plugin-runtime v0.90.0 github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core v0.90.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/LICENSE b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/LICENSE new file mode 100644 index 000000000..e69de29bb diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser.go new file mode 100644 index 000000000..fe34af938 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser.go @@ -0,0 +1,50 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + + "gopkg.in/yaml.v3" +) + +// parseContext unmarshalls string to Context struct +func parseContext(context string) (*configtypes.Context, error) { + var ctx configtypes.Context + err := yaml.Unmarshal([]byte(context), &ctx) + if err != nil { + return nil, err + } + return &ctx, nil +} + +// parseServer unmarshalls string to Server struct +func parseServer(server string) (*configtypes.Server, error) { //nolint:staticcheck // Deprecated + var s configtypes.Server //nolint:staticcheck // Deprecated + err := yaml.Unmarshal([]byte(server), &s) + if err != nil { + return nil, err + } + return &s, nil +} + +// parseCLIDiscoverySource unmarshalls string to PluginDiscovery struct +func parseCLIDiscoverySource(source string) (*configtypes.PluginDiscovery, error) { + var pluginDiscovery configtypes.PluginDiscovery + err := yaml.Unmarshal([]byte(source), &pluginDiscovery) + if err != nil { + return nil, err + } + return &pluginDiscovery, nil +} + +// parseClientConfig unmarshalls string to ClientConfig struct +func parseClientConfig(cfgStr string) (*configtypes.ClientConfig, error) { + var cfg configtypes.ClientConfig + err := yaml.Unmarshal([]byte(cfgStr), &cfg) + if err != nil { + return nil, err + } + return &cfg, nil +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser_test.go new file mode 100644 index 000000000..d7d623381 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/parser_test.go @@ -0,0 +1,94 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" +) + +func TestParseContext(t *testing.T) { + tests := []struct { + name string + ctxStr string + err string + expectedContext *configtypes.Context + }{ + { + name: "Parse valid context str", + ctxStr: `name: context-one +target: kubernetes +globalOpts: + endpoint: test-endpoint +`, + expectedContext: &configtypes.Context{ + Name: "context-one", + Target: "kubernetes", + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "test-endpoint", + }, + }, + }, + { + name: "Failed to parse invalid string", + ctxStr: `name`, + err: "yaml: unmarshal errors:\n line 1: cannot unmarshal !!str `name` into types.Context", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actual, err := parseContext(tt.ctxStr) + if tt.err != "" || err != nil { + assert.Equal(t, tt.err, err.Error()) + } else { + assert.Equal(t, tt.expectedContext, actual) + } + }) + } +} + +func TestParseServer(t *testing.T) { + tests := []struct { + name string + serverStr string + err string + expectedServer *configtypes.Server + }{ + { + name: "Parse valid context str", + serverStr: `name: compatibility-test-one +type: managementcluster +globalOpts: + endpoint: default-compatibility-test-endpoint +`, + expectedServer: &configtypes.Server{ + Name: "compatibility-test-one", + Type: configtypes.ManagementClusterServerType, + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "default-compatibility-test-endpoint", + }, + }, + }, + { + name: "Failed to parse invalid string", + serverStr: `name`, + err: "yaml: unmarshal errors:\n line 1: cannot unmarshal !!str `name` into types.Server", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actual, err := parseServer(tt.serverStr) + if tt.err != "" || err != nil { + assert.Equal(t, tt.err, err.Error()) + } else { + assert.Equal(t, tt.expectedServer, actual) + } + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/root.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/root.go new file mode 100644 index 000000000..cce26018f --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/root.go @@ -0,0 +1,27 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Package cmd contains root and test command to trigger apis +package cmd + +import ( + "os" + + "github.com/spf13/cobra" +) + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "runtime-test-plugin-v1_0_2", + Short: "runtime cross-version api compatibility test plugin", + Long: `A test plugin with runtime lib latest used for cross-version api compatibility testing of runtime config apis`, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + err := rootCmd.Execute() + if err != nil { + os.Exit(1) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/test.go new file mode 100644 index 000000000..0e87d2e5b --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/test.go @@ -0,0 +1,50 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + "gopkg.in/yaml.v3" + + compatibilitytestingcore "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// testCmd represents the test command +var ( + filepath string + testCmd = &cobra.Command{ + Use: "test", + Short: "A test command that parse the file and trigger the runtime apis", + Run: func(cmd *cobra.Command, args []string) { + // Parse the file into array of apis struct + apis, err := compatibilitytestingcore.ParseRuntimeAPIsFromFile(filepath) + if err != nil { + fmt.Println(err) + } + // Trigger Runtime APIs + runAPIs(apis) + }, + } +) + +func init() { + rootCmd.AddCommand(testCmd) + testCmd.Flags().StringVarP(&filepath, "file", "f", "", "test file path") +} + +// runAPIs loop through the apis and trigger the runtime api methods and print logs to stdout +func runAPIs(apis []compatibilitytestingcore.API) { + // Trigger apis and return logs to be printed + logs := triggerAPIs(apis) + + // Log the output to stdout + bytes, err := yaml.Marshal(logs) + if err != nil { + fmt.Println("runAPIs", err) + } + + fmt.Println(string(bytes)) +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_apis.go new file mode 100644 index 000000000..d5556869f --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_apis.go @@ -0,0 +1,98 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// Route to runtime API method call based on passed command value +var apiHandlers = map[core.RuntimeAPIName]func(*core.API) *core.APIResponse{ + // Context APIs + core.SetContextAPI: triggerSetContextAPI, + core.GetContextAPIName: triggerGetContextAPI, + core.RemoveContextAPI: triggerDeleteContextAPI, + core.DeleteContextAPI: triggerDeleteContextAPI, + core.SetCurrentContextAPI: triggerSetCurrentContextAPI, + core.GetCurrentContextAPI: triggerGetCurrentContextAPI, + core.RemoveCurrentContextAPI: triggerRemoveCurrentContextAPI, + + // Server APIs + core.SetServerAPI: triggerSetServerAPI, + core.AddServerAPI: triggerSetServerAPI, + core.PutServerAPI: triggerSetServerAPI, + core.GetServerAPI: triggerGetServerAPI, + core.RemoveServerAPI: triggerRemoveServerAPI, + core.DeleteServerAPI: triggerRemoveServerAPI, + core.SetCurrentServerAPI: triggerSetCurrentServerAPI, + core.GetCurrentServerAPI: triggerGetCurrentServerAPI, + core.RemoveCurrentServerAPI: triggerRemoveCurrentServerAPI, + + // Feature APIs + core.SetFeatureAPI: triggerSetFeatureAPI, + core.IsFeatureEnabledAPI: triggerIsFeatureEnabledAPI, + core.DeleteFeatureAPI: triggerDeleteFeatureAPI, + + // Env APIs + core.SetEnvAPI: triggerSetEnvAPI, + core.GetEnvAPI: triggerGetEnvAPI, + core.GetEnvConfigurationsAPI: triggerGetEnvConfigurationsAPI, + core.DeleteEnvAPI: triggerDeleteEnvAPI, + + // CLI Discovery Source APIs + core.SetCLIDiscoverySourceAPI: triggerSetCLIDiscoverySourceAPI, + core.GetCLIDiscoverySourceAPI: triggerGetCLIDiscoverySourceAPI, + core.DeleteCLIDiscoverySourceAPI: triggerDeleteCLIDiscoverySourceAPI, + + // Metadata APIs + core.SetConfigMetadataSettingAPI: triggerSetConfigMetadataSettingAPI, + core.SetConfigMetadataPatchStrategyAPI: triggerSetConfigMetadataPatchStrategyAPI, + core.DeleteConfigMetadataSettingAPI: triggerDeleteConfigMetadataSettingAPI, + core.GetMetadataAPI: triggerGetMetadataAPI, + core.GetConfigMetadataAPI: triggerGetConfigMetadataAPI, + core.GetConfigMetadataPatchStrategyAPI: triggerGetConfigMetadataPatchStrategyAPI, + core.GetConfigMetadataSettingsAPI: triggerGetConfigMetadataSettingsAPI, + core.GetConfigMetadataSettingAPI: triggerGetConfigMetadataSettingAPI, + core.IsConfigMetadataSettingsEnabledAPI: triggerIsConfigMetadataSettingsEnabledAPI, + core.UseUnifiedConfigAPI: triggerUseUnifiedConfigAPI, + + // Global APIs + core.GetClientConfigAPI: triggerGetClientConfigAPI, + core.StoreClientConfigAPI: triggerStoreClientConfigAPI, +} + +// triggerAPIs trigger runtime apis and construct logs +func triggerAPIs(apis []core.API) map[core.RuntimeAPIName][]core.APILog { + // Variable used to store all the logging related to runtime api responses + logs := make(map[core.RuntimeAPIName][]core.APILog) + + // Loop through array of commands + for index := range apis { + api := &apis[index] + handler, ok := apiHandlers[api.Name] + if !ok { + log := core.APILog{ + APIResponse: &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("command %v not found", api.Name), + }, + } + logs[api.Name] = append(logs[api.Name], log) + continue + } + + // Trigger the API handler + apiResponse := handler(api) + + // Construct the logs + log := core.APILog{ + APIResponse: apiResponse, + } + logs[api.Name] = append(logs[api.Name], log) + } + + return logs +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_discovery_source_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_discovery_source_apis_test.go new file mode 100644 index 000000000..801447bc2 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_discovery_source_apis_test.go @@ -0,0 +1,212 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +const sourceOne string = "compatibility-tests-source-one" +const sourceImage string = "compatibility-tests-source-image" + +func TestTriggerCLIDiscoverySourceAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + source := ` +oci: + name: compatibility-tests-source-one + image: compatibility-tests-source-image +` + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetCLIDiscoverySourceAPI", + apiName: core.SetCLIDiscoverySourceAPI, + apis: []core.API{ + { + Name: core.SetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.DiscoverySource: source, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.DiscoverySource: source, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetCLIDiscoverySourceAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetCLIDiscoverySourceAPI", + apiName: core.GetCLIDiscoverySourceAPI, + apis: []core.API{ + { + Name: core.SetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.DiscoverySource: source, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.GetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Name: sourceOne, + }, + Output: &core.Output{ + Result: "success", + Content: source, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetCLIDiscoverySourceAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: &configtypes.PluginDiscovery{ + OCI: &configtypes.OCIDiscovery{ + Name: sourceOne, + Image: sourceImage, + }, + }, + ResponseType: core.MapResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteCLIDiscoverySourceAPI", + apiName: core.DeleteCLIDiscoverySourceAPI, + apis: []core.API{ + { + Name: core.SetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.DiscoverySource: source, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Name: sourceOne, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteCLIDiscoverySourceAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteCLIDiscoverySourceAPI", + apiName: core.DeleteCLIDiscoverySourceAPI, + apis: []core.API{ + { + Name: core.SetCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.DiscoverySource: source, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteCLIDiscoverySourceAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Name: sourceOne, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteCLIDiscoverySourceAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_disocvery_source_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_disocvery_source_apis.go new file mode 100644 index 000000000..bb50a003c --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_cli_disocvery_source_apis.go @@ -0,0 +1,105 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + "github.com/pkg/errors" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetCLIDiscoverySourceAPI trigger get cli discovery source name runtime api +func triggerGetCLIDiscoverySourceAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + name, err := core.ParseStr(api.Arguments[core.Name]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Name, err.Error()), + } + } + return getCLIDiscoverySource(name) +} + +// triggerSetCLIDiscoverySourceAPI trigger add server runtime api +func triggerSetCLIDiscoverySourceAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + source, err := parseCLIDiscoverySource(api.Arguments[core.DiscoverySource].(string)) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse discovery source from argument %v with error %v ", core.DiscoverySource, err.Error()), + } + } + return setCLIDiscoverySource(source) +} + +// triggerDeleteCLIDiscoverySourceAPI trigger remove context runtime api +func triggerDeleteCLIDiscoverySourceAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + name, err := core.ParseStr(api.Arguments[core.Name]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Name, err.Error()), + } + } + return deleteCLIDiscoverySource(name) +} + +func getCLIDiscoverySource(name string) *core.APIResponse { + // Call runtime GetCLIDiscoverySource API + source, err := configlib.GetCLIDiscoverySource(name) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if source == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("source %v not found", source), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: source, + } +} + +func setCLIDiscoverySource(source *configtypes.PluginDiscovery) *core.APIResponse { + // Call runtime SetCLIDiscoverySource API + err := configlib.SetCLIDiscoverySource(*source) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: errors.Wrap(err, "failed"), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func deleteCLIDiscoverySource(name string) *core.APIResponse { + // Call runtime RemoveCLIDiscoverySource API + err := configlib.DeleteCLIDiscoverySource(name) + + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis.go new file mode 100644 index 000000000..e8fe2d49b --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis.go @@ -0,0 +1,193 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetContextAPI trigger Runtime GetContext API +func triggerGetContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime GetContext API + ctxName, err := core.ParseStr(api.Arguments[core.ContextName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.ContextName, err), + } + } + // Trigger GetContext API + return getContext(ctxName) +} + +// triggerSetContextAPI trigger Runtime SetContext API +func triggerSetContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime SetContext API + ctx, err := parseContext(api.Arguments[core.Context].(string)) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse context from argument %v with error %v ", core.Context, err.Error()), + } + } + setCurrent := api.Arguments[core.SetCurrent].(bool) + // Trigger SetContext API + return setContext(ctx, setCurrent) +} + +// triggerDeleteContextAPI trigger Runtime DeleteContext API +func triggerDeleteContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime DeleteContext API + ctxName, err := core.ParseStr(api.Arguments[core.ContextName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.ContextName, err.Error()), + } + } + // Trigger DeleteContext API + return deleteContext(ctxName) +} + +// triggerSetCurrentContextAPI trigger Runtime SetCurrentContext API +func triggerSetCurrentContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime SetCurrentContext API + ctxName, err := core.ParseStr(api.Arguments[core.ContextName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.ContextName, err.Error()), + } + } + // Trigger SetCurrentContext API + return setCurrentContext(ctxName) +} + +// triggerGetCurrentContextAPI trigger Runtime GetCurrentContext API +func triggerGetCurrentContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime GetCurrentContext API + target, err := core.ParseStr(api.Arguments[core.Target]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Target, err.Error()), + } + } + // Trigger GetCurrentContext API + return getCurrentContext(configtypes.Target(target)) +} + +// triggerRemoveCurrentContextAPI trigger Runtime RemoveCurrentContext API +func triggerRemoveCurrentContextAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime RemoveCurrentContext API + target, err := core.ParseStr(api.Arguments[core.Target]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Target, err.Error()), + } + } + // Trigger RemoveCurrentContext + return removeCurrentContext(configtypes.Target(target)) +} + +func getContext(ctxName string) *core.APIResponse { + ctx, err := configlib.GetContext(ctxName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if ctx == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("context %s not found", ctxName), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: ctx, + } +} + +func setContext(context *configtypes.Context, setCurrent bool) *core.APIResponse { + err := configlib.SetContext(context, setCurrent) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func deleteContext(contextName string) *core.APIResponse { + err := configlib.DeleteContext(contextName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func setCurrentContext(contextName string) *core.APIResponse { + err := configlib.SetCurrentContext(contextName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func getCurrentContext(target configtypes.Target) *core.APIResponse { + ctx, err := configlib.GetCurrentContext(target) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if ctx == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("context %s not found", target), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: ctx, + } +} + +func removeCurrentContext(target configtypes.Target) *core.APIResponse { + err := configlib.RemoveCurrentContext(target) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis_test.go new file mode 100644 index 000000000..929136d99 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_context_apis_test.go @@ -0,0 +1,348 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +func TestTriggerContextAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + ctx := `name: context-one +target: kubernetes +globalOpts: + endpoint: test-endpoint +` + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetContext API", + apiName: core.SetContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetContext API", + apiName: core.GetContextAPIName, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.GetContextAPIName, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: ctx, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetContextAPIName: { + { + APIResponse: &core.APIResponse{ + ResponseBody: &configtypes.Context{ + Name: "context-one", + Target: "kubernetes", + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "test-endpoint", + }, + }, + ResponseType: core.MapResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger RemoveContext API", + apiName: core.RemoveContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.RemoveContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.RemoveContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteContext API", + apiName: core.DeleteContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger SetCurrentContext API", + apiName: core.SetCurrentContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetCurrentContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetCurrentContext API", + apiName: core.GetCurrentContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.GetCurrentContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Target: "kubernetes", + }, + Output: &core.Output{ + Result: "success", + Content: ctx, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetCurrentContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: &configtypes.Context{ + Name: "context-one", + Target: "kubernetes", + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "test-endpoint", + }, + }, + ResponseType: core.MapResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger RemoveCurrentContext API", + apiName: core.RemoveCurrentContextAPI, + apis: []core.API{ + { + Name: core.SetContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Context: ctx, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ContextName: "context-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.RemoveCurrentContextAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Target: "kubernetes", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.RemoveCurrentContextAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis.go new file mode 100644 index 000000000..627eb0c08 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis.go @@ -0,0 +1,130 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetEnvConfigurationsAPI trigger Runtime GetEnvConfigurations API +func triggerGetEnvConfigurationsAPI(_ *core.API) *core.APIResponse { + // Trigger GetEnvConfigurations API + return getEnvConfigurations() +} + +// triggerGetEnvAPI trigger Runtime GetEnv API +func triggerGetEnvAPI(api *core.API) *core.APIResponse { + keyName, err := parseEnvArguments(api) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err, + } + } + + // Trigger GetEnv API + return getEnv(keyName) +} + +// triggerSetEnvAPI trigger Runtime SetEnv API +func triggerSetEnvAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime SetEnv API + keyName, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + } + } + + valueName, err := core.ParseStr(api.Arguments[core.Value]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Value, err), + } + } + // Trigger SetEnv API + return setEnv(keyName, valueName) +} + +// triggerDeleteEnvAPI trigger Runtime DeleteEnv API +func triggerDeleteEnvAPI(api *core.API) *core.APIResponse { + keyName, err := parseEnvArguments(api) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err, + } + } + + // Trigger DeleteEnv API + return deleteEnv(keyName) +} + +func getEnvConfigurations() *core.APIResponse { + envs := configlib.GetEnvConfigurations() + + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: envs, + } +} + +func getEnv(keyName string) *core.APIResponse { + enabled, err := configlib.GetEnv(keyName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + + return &core.APIResponse{ + ResponseType: core.StringResponse, + ResponseBody: enabled, + } +} + +func setEnv(keyName, valueName string) *core.APIResponse { + err := configlib.SetEnv(keyName, valueName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func deleteEnv(keyName string) *core.APIResponse { + err := configlib.DeleteEnv(keyName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func parseEnvArguments(api *core.API) (string, error) { + // Parse arguments needed to trigger the Runtime GetEnv API + keyName, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return "", + fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err) + } + + return keyName, nil +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis_test.go new file mode 100644 index 000000000..d1c5c3995 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_env_apis_test.go @@ -0,0 +1,161 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +func TestTriggerEnvAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetEnv API", + apiName: core.SetEnvAPI, + apis: []core.API{ + { + Name: core.SetEnvAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: "compatibility-tests", + core.Value: "default-env-val", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetEnvAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GenEnv API", + apiName: core.GetEnvAPI, + apis: []core.API{ + { + Name: core.GetEnvAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: "compatibility-tests", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetEnvAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.StringResponse, + ResponseBody: "default-env-val", + }, + }, + }, + }, + }, + + { + name: "Trigger GenEnvConfigurations API", + apiName: core.GetEnvConfigurationsAPI, + apis: []core.API{ + { + Name: core.GetEnvConfigurationsAPI, + Version: core.VersionLatest, + Output: &core.Output{ + Result: "success", + Content: `compatibility-tests: default-env-val`, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetEnvConfigurationsAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: map[string]string{ + "compatibility-tests": "default-env-val", + }, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteEnv API", + apiName: core.DeleteEnvAPI, + apis: []core.API{ + { + Name: core.SetEnvAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: "compatibility-tests", + core.Value: "default-env-val", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteEnvAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: "compatibility-tests", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteEnvAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis.go new file mode 100644 index 000000000..c80fc66ff --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis.go @@ -0,0 +1,129 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerIsFeatureEnabledAPI trigger Runtime IsFeatureEnabled API +func triggerIsFeatureEnabledAPI(api *core.API) *core.APIResponse { + pluginName, keyName, err := parseFeatureArguments(api) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err, + } + } + + // Trigger IsFeatureEnabled API + return isFeatureEnabled(pluginName, keyName) +} + +// triggerSetFeatureAPI trigger Runtime SetFeature API +func triggerSetFeatureAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime SetFeature API + pluginName, err := core.ParseStr(api.Arguments[core.Plugin]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Plugin, err), + } + } + + keyName, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + } + } + + valueName, err := core.ParseStr(api.Arguments[core.Value]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + } + } + // Trigger SetFeature API + return setFeature(pluginName, keyName, valueName) +} + +// triggerDeleteFeatureAPI trigger Runtime DeleteFeature API +func triggerDeleteFeatureAPI(api *core.API) *core.APIResponse { + pluginName, keyName, err := parseFeatureArguments(api) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err, + } + } + + // Trigger DeleteFeature API + return deleteFeature(pluginName, keyName) +} + +func isFeatureEnabled(pluginName, keyName string) *core.APIResponse { + enabled, err := configlib.IsFeatureEnabled(pluginName, keyName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + + return &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: enabled, + } +} + +func setFeature(pluginName, keyName, valueName string) *core.APIResponse { + err := configlib.SetFeature(pluginName, keyName, valueName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func deleteFeature(pluginName, keyName string) *core.APIResponse { + err := configlib.DeleteFeature(pluginName, keyName) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func parseFeatureArguments(api *core.API) (string, string, error) { + // Parse arguments needed to trigger the Runtime IsFeatureEnabled API + pluginName, err := core.ParseStr(api.Arguments[core.Plugin]) + if err != nil { + return "", "", + fmt.Errorf("failed to parse string from argument %v with error %v", core.Plugin, err) + } + + keyName, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return "", "", + fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err) + } + + return pluginName, keyName, nil +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis_test.go new file mode 100644 index 000000000..0dc90d551 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_feature_apis_test.go @@ -0,0 +1,137 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +func TestTriggerFeatureAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetFeature API", + apiName: core.SetFeatureAPI, + apis: []core.API{ + { + Name: core.SetFeatureAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Plugin: "test-plugin", + core.Key: "compatibility-tests", + core.Value: "true", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetFeatureAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger IsFeatureEnabled API", + apiName: core.IsFeatureEnabledAPI, + apis: []core.API{ + { + Name: core.IsFeatureEnabledAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Plugin: "test-plugin", + core.Key: "compatibility-tests", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.IsFeatureEnabledAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: true, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteFeature API", + apiName: core.DeleteFeatureAPI, + apis: []core.API{ + { + Name: core.SetFeatureAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Plugin: "test-plugin", + core.Key: "compatibility-tests", + core.Value: "true", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteFeatureAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Plugin: "test-plugin", + core.Key: "compatibility-tests", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteFeatureAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_legacyclientconfig_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_legacyclientconfig_apis.go new file mode 100644 index 000000000..96fb1c16b --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_legacyclientconfig_apis.go @@ -0,0 +1,67 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetClientConfigAPI trigger Runtime GetClientConfig API +func triggerGetClientConfigAPI(_ *core.API) *core.APIResponse { + // Trigger GetClientConfig API + return getClientConfig() +} + +// triggerStoreClientConfigAPI trigger Runtime StoreClientConfig API +func triggerStoreClientConfigAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime AddContext API + cfg, err := parseClientConfig(api.Arguments[core.ClientConfig].(string)) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.ClientConfig, err), + } + } + // Trigger AddContext API + return storeClientConfig(cfg) +} + +func getClientConfig() *core.APIResponse { + cfg, err := configlib.GetClientConfig() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if cfg == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("clientconfig %v not found", cfg), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: cfg, + } +} + +func storeClientConfig(cfg *configtypes.ClientConfig) *core.APIResponse { + err := configlib.StoreClientConfig(cfg) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis.go new file mode 100644 index 000000000..64dac6dcc --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis.go @@ -0,0 +1,289 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetMetadataAPI trigger Runtime GetMetadata API +func triggerGetMetadataAPI(_ *core.API) *core.APIResponse { + // Trigger GetMetadata API + return getMetadata() +} + +// triggerGetConfigMetadataAPI trigger Runtime GetConfigMetadata API +func triggerGetConfigMetadataAPI(_ *core.API) *core.APIResponse { + // Trigger GetConfigMetadata API + return getConfigMetadata() +} + +// triggerGetConfigMetadataPatchStrategyAPI trigger Runtime GetConfigMetadataPatchStrategy API +func triggerGetConfigMetadataPatchStrategyAPI(_ *core.API) *core.APIResponse { + // Trigger GetConfigMetadataPatchStrategy API + return getConfigMetadataPatchStrategy() +} + +// triggerGetConfigMetadataSettingsAPI trigger Runtime GetConfigMetadataSettings API +func triggerGetConfigMetadataSettingsAPI(_ *core.API) *core.APIResponse { + // Trigger GetConfigMetadataSettings API + return getConfigMetadataSettings() +} + +// triggerGetConfigMetadataSettingAPI trigger Runtime GetConfigMetadataSetting API +func triggerGetConfigMetadataSettingAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime GetConfigMetadataSetting API + key, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + } + } + // Trigger GetConfigMetadataSetting API + return getConfigMetadataSetting(key) +} + +// triggerIsConfigMetadataSettingsEnabledAPI trigger Runtime IsConfigMetadataSettingsEnabled API +func triggerIsConfigMetadataSettingsEnabledAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime IsConfigMetadataSettingsEnabled API + key, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + } + } + // Trigger IsConfigMetadataSettingsEnabled API + return isConfigMetadataSettingsEnabled(key) +} + +// triggerUseUnifiedConfigAPI trigger Runtime UseUnifiedConfig API +func triggerUseUnifiedConfigAPI(_ *core.API) *core.APIResponse { + // Trigger UseUnifiedConfig API + return useUnifiedConfig() +} + +// triggerSetConfigMetadataSettingAPI trigger Runtime SetConfigMetadataSetting API +func triggerSetConfigMetadataSettingAPI(api *core.API) *core.APIResponse { + keyName, valueName, response, done := parseMetadataArguments(api) + if done { + return response + } + // Trigger SetConfigMetadataSetting API + return setConfigMetadataSetting(keyName, valueName) +} + +// triggerSetConfigMetadataPatchStrategyAPI trigger Runtime SetConfigMetadataPatchStrategy API +func triggerSetConfigMetadataPatchStrategyAPI(api *core.API) *core.APIResponse { + keyName, valueName, response, done := parseMetadataArguments(api) + if done { + return response + } + // Trigger SetConfigMetadataPatchStrategy API + return setConfigMetadataPatchStrategy(keyName, valueName) +} + +// triggerDeleteConfigMetadataSettingAPI trigger Runtime DeleteConfigMetadataSetting API +func triggerDeleteConfigMetadataSettingAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the Runtime DeleteConfigMetadataSetting API + key, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Key, err.Error()), + } + } + // Trigger DeleteConfigMetadataSetting API + return deleteConfigMetadataSetting(key) +} + +func getMetadata() *core.APIResponse { + metadata, err := configlib.GetMetadata() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if metadata == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("metadata %v not found", metadata), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: metadata, + } +} + +func getConfigMetadata() *core.APIResponse { + cfgMetadata, err := configlib.GetConfigMetadata() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if cfgMetadata == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("config metadata %s not found", cfgMetadata), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: cfgMetadata, + } +} + +func getConfigMetadataPatchStrategy() *core.APIResponse { + patchStrategy, err := configlib.GetConfigMetadataPatchStrategy() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if len(patchStrategy) == 0 { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("config metadata patch strategy %s not found", patchStrategy), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: patchStrategy, + } +} + +func getConfigMetadataSettings() *core.APIResponse { + settings, err := configlib.GetConfigMetadataSettings() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if len(settings) == 0 { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("metadata settings not found"), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: settings, + } +} + +func getConfigMetadataSetting(key string) *core.APIResponse { + val, err := configlib.GetConfigMetadataSetting(key) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + + return &core.APIResponse{ + ResponseType: core.StringResponse, + ResponseBody: val, + } +} + +func isConfigMetadataSettingsEnabled(key string) *core.APIResponse { + enabled, err := configlib.IsConfigMetadataSettingsEnabled(key) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + + return &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: enabled, + } +} + +func useUnifiedConfig() *core.APIResponse { + enabled, err := configlib.UseUnifiedConfig() + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + + return &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: enabled, + } +} + +func setConfigMetadataSetting(key, value string) *core.APIResponse { + err := configlib.SetConfigMetadataSetting(key, value) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func setConfigMetadataPatchStrategy(key, value string) *core.APIResponse { + err := configlib.SetConfigMetadataPatchStrategy(key, value) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func deleteConfigMetadataSetting(key string) *core.APIResponse { + err := configlib.DeleteConfigMetadataSetting(key) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func parseMetadataArguments(api *core.API) (string, string, *core.APIResponse, bool) { + keyName, err := core.ParseStr(api.Arguments[core.Key]) + if err != nil { + return "", "", &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Key, err), + }, true + } + + valueName, err := core.ParseStr(api.Arguments[core.Value]) + if err != nil { + return "", "", &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v", core.Value, err), + }, true + } + return keyName, valueName, nil, false +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis_test.go new file mode 100644 index 000000000..4f1cfa5ff --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_metadata_apis_test.go @@ -0,0 +1,314 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +const ( + CompatibilityTestsMetadataPatchStrategyKey = "compatibility-tests.contexts.name" + CompatibilityTestsMetadataPatchStrategyValue = "replace" + CompatibilityTestsMetadataSettingsKey = "useUnifiedConfig" + CompatibilityTestsMetadataSettingsValue = "true" +) + +func TestTriggerMetadataAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetConfigMetadataSetting API", + apiName: core.SetConfigMetadataSettingAPI, + apis: []core.API{ + { + Name: core.SetConfigMetadataSettingAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + core.Value: CompatibilityTestsMetadataSettingsValue, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetConfigMetadataSettingAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger SetConfigMetadataPatchStrategy API", + apiName: core.SetConfigMetadataPatchStrategyAPI, + apis: []core.API{ + { + Name: core.SetConfigMetadataPatchStrategyAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataPatchStrategyKey, + core.Value: CompatibilityTestsMetadataPatchStrategyValue, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetConfigMetadataPatchStrategyAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetMetadata API", + apiName: core.GetMetadataAPI, + apis: []core.API{ + { + Name: core.GetMetadataAPI, + Version: core.VersionLatest, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetMetadataAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: &types.Metadata{ + ConfigMetadata: &types.ConfigMetadata{ + PatchStrategy: map[string]string{CompatibilityTestsMetadataPatchStrategyKey: CompatibilityTestsMetadataPatchStrategyValue}, + Settings: map[string]string{CompatibilityTestsMetadataSettingsKey: CompatibilityTestsMetadataSettingsValue}, + }, + }, + }, + }, + }, + }, + }, + + { + name: "Trigger GetConfigMetadata API", + apiName: core.GetConfigMetadataAPI, + apis: []core.API{ + { + Name: core.GetConfigMetadataAPI, + Version: core.VersionLatest, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetConfigMetadataAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: &types.ConfigMetadata{ + PatchStrategy: map[string]string{CompatibilityTestsMetadataPatchStrategyKey: CompatibilityTestsMetadataPatchStrategyValue}, + Settings: map[string]string{CompatibilityTestsMetadataSettingsKey: CompatibilityTestsMetadataSettingsValue}, + }, + }, + }, + }, + }, + }, + + { + name: "Trigger GetConfigMetadataPatchStrategy API", + apiName: core.GetConfigMetadataPatchStrategyAPI, + apis: []core.API{ + { + Name: core.GetConfigMetadataPatchStrategyAPI, + Version: core.VersionLatest, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetConfigMetadataPatchStrategyAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: map[string]string{CompatibilityTestsMetadataPatchStrategyKey: CompatibilityTestsMetadataPatchStrategyValue}, + }, + }, + }, + }, + }, + + { + name: "Trigger GetConfigMetadataSettings API", + apiName: core.GetConfigMetadataSettingsAPI, + apis: []core.API{ + { + Name: core.GetConfigMetadataSettingsAPI, + Version: core.VersionLatest, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetConfigMetadataSettingsAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: map[string]string{CompatibilityTestsMetadataSettingsKey: CompatibilityTestsMetadataSettingsValue}, + }, + }, + }, + }, + }, + + { + name: "Trigger GetConfigMetadataSetting API", + apiName: core.GetConfigMetadataSettingAPI, + apis: []core.API{ + { + Name: core.GetConfigMetadataSettingAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetConfigMetadataSettingAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.StringResponse, + ResponseBody: "true", + }, + }, + }, + }, + }, + + { + name: "Trigger IsConfigMetadataSettingsEnabledAPI API", + apiName: core.IsConfigMetadataSettingsEnabledAPI, + apis: []core.API{ + { + Name: core.IsConfigMetadataSettingsEnabledAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.IsConfigMetadataSettingsEnabledAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: true, + }, + }, + }, + }, + }, + + { + name: "Trigger UseUnifiedConfigAPI API", + apiName: core.UseUnifiedConfigAPI, + apis: []core.API{ + { + Name: core.UseUnifiedConfigAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.UseUnifiedConfigAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.BooleanResponse, + ResponseBody: true, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteConfigMetadataSettingAPI API", + apiName: core.DeleteConfigMetadataSettingAPI, + apis: []core.API{ + { + Name: core.DeleteConfigMetadataSettingAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteConfigMetadataSettingAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger UseUnifiedConfigAPI API", + apiName: core.UseUnifiedConfigAPI, + apis: []core.API{ + { + Name: core.UseUnifiedConfigAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Key: CompatibilityTestsMetadataSettingsKey, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.UseUnifiedConfigAPI: { + { + APIResponse: &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: "not found", + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis.go new file mode 100644 index 000000000..96b3c3fb4 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis.go @@ -0,0 +1,186 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "fmt" + + "github.com/pkg/errors" + + configlib "github.com/vmware-tanzu/tanzu-plugin-runtime/config" + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +// triggerGetServerAPI trigger get server runtime api +func triggerGetServerAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + serverName, err := core.ParseStr(api.Arguments[core.ServerName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.ServerName, err.Error()), + } + } + return getServer(serverName) +} + +// triggerSetServerAPI trigger add server runtime api +func triggerSetServerAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + server, err := parseServer(api.Arguments[core.Server].(string)) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse server from argument %v with error %v ", core.Server, err.Error()), + } + } + setCurrent := api.Arguments[core.SetCurrent].(bool) + return setServer(server, setCurrent) +} + +// triggerRemoveServerAPI trigger remove context runtime api +func triggerRemoveServerAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + serverName, err := core.ParseStr(api.Arguments[core.ServerName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.ServerName, err.Error()), + } + } + return removeServer(serverName) +} + +// triggerSetCurrentServerAPI trigger remove context runtime api +func triggerSetCurrentServerAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + serverName, err := core.ParseStr(api.Arguments[core.ServerName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.ServerName, err.Error()), + } + } + return setCurrentServer(serverName) +} + +// triggerGetCurrentServerAPI trigger remove context runtime api +func triggerGetCurrentServerAPI(*core.API) *core.APIResponse { + return getCurrentServer() +} + +// triggerRemoveCurrentServerAPI trigger remove server runtime api +func triggerRemoveCurrentServerAPI(api *core.API) *core.APIResponse { + // Parse arguments needed to trigger the runtime api + serverName, err := core.ParseStr(api.Arguments[core.ServerName]) + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("failed to parse string from argument %v with error %v ", core.Target, err.Error()), + } + } + return removeCurrentServer(serverName) +} + +func getServer(serverName string) *core.APIResponse { + // Call runtime GetServer API + server, err := configlib.GetServer(serverName) //nolint:staticcheck // Deprecated + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if server == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("server %v not found", server), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: server, + } +} + +func setServer(server *configtypes.Server, setCurrent bool) *core.APIResponse { //nolint:staticcheck // Deprecated + // Call runtime SetServer API + err := configlib.AddServer(server, setCurrent) //nolint:staticcheck // Deprecated + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: errors.Wrap(err, "failed"), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func removeServer(serverName string) *core.APIResponse { + // Call runtime RemoveServer API + err := configlib.RemoveServer(serverName) //nolint:staticcheck // Deprecated + + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func setCurrentServer(serverName string) *core.APIResponse { + // Call runtime SetCurrentServer API + err := configlib.SetCurrentServer(serverName) //nolint:staticcheck // Deprecated + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} + +func getCurrentServer() *core.APIResponse { + server, err := configlib.GetCurrentServer() //nolint:staticcheck // Deprecated + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + if server == nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: fmt.Errorf("server not found"), + } + } + return &core.APIResponse{ + ResponseType: core.MapResponse, + ResponseBody: server, + } +} + +func removeCurrentServer(serverName string) *core.APIResponse { + err := configlib.RemoveCurrentServer(serverName) //nolint:staticcheck // Deprecated + if err != nil { + return &core.APIResponse{ + ResponseType: core.ErrorResponse, + ResponseBody: err.Error(), + } + } + return &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis_test.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis_test.go new file mode 100644 index 000000000..b682fd33f --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd/trigger_server_apis_test.go @@ -0,0 +1,366 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + configtypes "github.com/vmware-tanzu/tanzu-plugin-runtime/config/types" + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core" +) + +func TestTriggerServerAPIs(t *testing.T) { + _, cleanup := core.SetupTempCfgFiles() + defer func() { + cleanup() + }() + server := `name: compatibility-test-one +type: managementcluster +globalOpts: + endpoint: test-endpoint +` + var tests = []struct { + name string + apiName core.RuntimeAPIName + apis []core.API + expectedLogs map[core.RuntimeAPIName][]core.APILog + }{ + { + name: "Trigger SetServerAPI", + apiName: core.SetServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetServerAPI", + apiName: core.GetServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.GetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: server, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: &configtypes.Server{ + Name: "compatibility-test-one", + Type: configtypes.ManagementClusterServerType, + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "test-endpoint", + }, + }, + ResponseType: core.MapResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger RemoveServerAPI", + apiName: core.RemoveServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.RemoveServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.RemoveServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger DeleteServerAPI", + apiName: core.DeleteServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.DeleteServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.DeleteServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger SetCurrentServerAPI", + apiName: core.SetCurrentServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.SetCurrentServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger GetCurrentServerAPI", + apiName: core.GetCurrentServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.GetCurrentServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Target: "kubernetes", + }, + Output: &core.Output{ + Result: "success", + Content: server, + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.GetCurrentServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: &configtypes.Server{ + Name: "compatibility-test-one", + Type: configtypes.ManagementClusterServerType, + GlobalOpts: &configtypes.GlobalServer{ + Endpoint: "test-endpoint", + }, + }, + ResponseType: core.MapResponse, + }, + }, + }, + }, + }, + + { + name: "Trigger RemoveCurrentServerAPI", + apiName: core.RemoveCurrentServerAPI, + apis: []core.API{ + { + Name: core.SetServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.Server: server, + core.SetCurrent: false, + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.SetCurrentServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + { + Name: core.RemoveCurrentServerAPI, + Version: core.VersionLatest, + Arguments: map[core.APIArgumentType]interface{}{ + core.ServerName: "compatibility-test-one", + }, + Output: &core.Output{ + Result: "success", + Content: "", + }, + }, + }, + + expectedLogs: map[core.RuntimeAPIName][]core.APILog{ + core.RemoveCurrentServerAPI: { + { + APIResponse: &core.APIResponse{ + ResponseBody: "", + ResponseType: core.StringResponse, + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actualLogs := triggerAPIs(tt.apis) + assert.Equal(t, tt.expectedLogs[tt.apiName], actualLogs[tt.apiName]) + }) + } +} diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.mod b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.mod new file mode 100644 index 000000000..4491910aa --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.mod @@ -0,0 +1,25 @@ +module github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/testplugins/runtime-test-plugin-v1_0_2 + +go 1.18 + +replace github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core => ../../core + +require ( + github.com/spf13/cobra v1.7.0 + github.com/vmware-tanzu/tanzu-plugin-runtime v1.0.2 + github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/core v1.0.2 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.8.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.sum b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.sum new file mode 100644 index 000000000..ae7ce0ab9 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.sum @@ -0,0 +1,37 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b h1:FQ7+9fxhyp82ks9vAuyPzG0/vVbWwMwLJ+P6yJI5FN8= +github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b/go.mod h1:HMcgvsgd0Fjj4XXDkbjdmlbI505rUPBs6WBMYg2pXks= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +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= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +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.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= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk= +github.com/vmware-tanzu/tanzu-plugin-runtime v1.0.2 h1:9QL2KHJ8vOCRVXGcMUlhxTqTNFHYmSjoJI/0crZZ9jE= +github.com/vmware-tanzu/tanzu-plugin-runtime v1.0.2/go.mod h1:wMK/qpJjU7hytDAGt3FX5/iGdlUK8TsJLu36pCr+Zvk= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work new file mode 100644 index 000000000..9a21ec734 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work @@ -0,0 +1,5 @@ +go 1.18 + +use ( + . +) diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work.sum b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work.sum new file mode 100644 index 000000000..c6833b786 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/go.work.sum @@ -0,0 +1,21 @@ +github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw= +github.com/briandowns/spinner v1.19.0 h1:s8aq38H+Qju89yhp89b4iIiMzMm8YN3p6vGpwyh/a8E= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/vmware-tanzu/tanzu-plugin-runtime v1.0.2/go.mod h1:wMK/qpJjU7hytDAGt3FX5/iGdlUK8TsJLu36pCr+Zvk= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= diff --git a/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/main.go b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/main.go new file mode 100644 index 000000000..2561928d6 --- /dev/null +++ b/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/main.go @@ -0,0 +1,13 @@ +// Copyright 2023 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// Package main contains test cli plugin to trigger various runtime APIs +package main + +import ( + "github.com/vmware-tanzu/tanzu-plugin-runtime/test/compatibility/testplugins/runtime-test-plugin-v1_0_2/cmd" +) + +func main() { + cmd.Execute() +}