From bec0c9687acf6a5dbba0d149907c0773c7748694 Mon Sep 17 00:00:00 2001 From: Prashansa Kulshrestha Date: Thu, 10 Oct 2024 11:45:40 +0530 Subject: [PATCH] tests: added separate tests for gateway ee feature --- tests/integration/validate_test.go | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/integration/validate_test.go b/tests/integration/validate_test.go index 9259d7e7b..0173e9fde 100644 --- a/tests/integration/validate_test.go +++ b/tests/integration/validate_test.go @@ -127,6 +127,46 @@ func Test_Validate_Gateway(t *testing.T) { setup(t) runWhen(t, "kong", ">=2.8.0") + tests := []struct { + name string + stateFile string + additionalArgs []string + errorExpected bool + }{ + { + name: "validate format version 1.1", + stateFile: "testdata/validate/kong.yaml", + additionalArgs: []string{}, + }, + { + name: "validate format version 3.0", + stateFile: "testdata/validate/kong3x.yaml", + additionalArgs: []string{}, + }, + { + name: "validate with --konnect-compatibility", + stateFile: "testdata/validate/konnect.yaml", + additionalArgs: []string{"--konnect-compatibility"}, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + validateOpts := []string{ + tc.stateFile, + } + validateOpts = append(validateOpts, tc.additionalArgs...) + + err := validate(true, validateOpts...) + assert.NoError(t, err) + }) + } +} + +func Test_Validate_Gateway_EE(t *testing.T) { + setup(t) + runWhen(t, "enterprise", ">=2.8.0") + tests := []struct { name string stateFile string