diff --git a/cmd/common_konnect.go b/cmd/common_konnect.go index 97fbdaee2..2850bc56e 100644 --- a/cmd/common_konnect.go +++ b/cmd/common_konnect.go @@ -129,7 +129,6 @@ func resetKonnectV2(ctx context.Context) error { if err != nil { return err } - dumpConfig.IsConsumerGroupScopedPluginSupported = true if dumpConfig.KonnectRuntimeGroup == "" { dumpConfig.KonnectRuntimeGroup = defaultRuntimeGroupName } diff --git a/tests/integration/dump_test.go b/tests/integration/dump_test.go index 63a6d0d04..8c49fc9ad 100644 --- a/tests/integration/dump_test.go +++ b/tests/integration/dump_test.go @@ -82,125 +82,54 @@ func Test_Dump_SkipConsumers(t *testing.T) { stateFile string expectedFile string skipConsumers bool + runWhen func(t *testing.T) }{ { - name: "dump with skip-consumers", + name: "3.2 & 3.3 dump with skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong.yaml", expectedFile: "testdata/dump/002-skip-consumers/expected.yaml", skipConsumers: true, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.2.0 <3.4.0") }, }, { - name: "dump with no skip-consumers", + name: "3.2 & 3.3 dump with no skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong.yaml", expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip.yaml", skipConsumers: false, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.2.0 <3.4.0") }, }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - runWhen(t, "enterprise", ">=3.2.0 <3.4.0") - teardown := setup(t) - defer teardown(t) - - assert.NoError(t, sync(tc.stateFile)) - - var ( - output string - err error - ) - if tc.skipConsumers { - output, err = dump( - "--skip-consumers", - "-o", "-", - ) - } else { - output, err = dump( - "-o", "-", - ) - } - assert.NoError(t, err) - - expected, err := readFile(tc.expectedFile) - assert.NoError(t, err) - assert.Equal(t, expected, output) - }) - } -} - -func Test_Dump_SkipConsumers_34x(t *testing.T) { - tests := []struct { - name string - stateFile string - expectedFile string - skipConsumers bool - }{ { - name: "dump with skip-consumers", + name: "3.4 dump with skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", expectedFile: "testdata/dump/002-skip-consumers/expected.yaml", skipConsumers: true, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.4.0 <3.5.0") }, }, { - name: "dump with no skip-consumers", + name: "3.4 dump with no skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", - expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-34.yaml", + expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip.yaml", skipConsumers: false, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.4.0 <3.5.0") }, }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - runWhen(t, "enterprise", ">=3.4.0 <3.5.0") - teardown := setup(t) - defer teardown(t) - - assert.NoError(t, sync(tc.stateFile)) - - var ( - output string - err error - ) - if tc.skipConsumers { - output, err = dump( - "--skip-consumers", - "-o", "-", - ) - } else { - output, err = dump( - "-o", "-", - ) - } - assert.NoError(t, err) - - expected, err := readFile(tc.expectedFile) - assert.NoError(t, err) - assert.Equal(t, expected, output) - }) - } -} - -func Test_Dump_SkipConsumers_35x(t *testing.T) { - tests := []struct { - name string - stateFile string - expectedFile string - skipConsumers bool - }{ { - name: "dump with skip-consumers", + name: "3.5 dump with skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", expectedFile: "testdata/dump/002-skip-consumers/expected.yaml", skipConsumers: true, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0") }, }, { - name: "dump with no skip-consumers", + name: "3.5 dump with no skip-consumers", stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", - expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-35.yaml", + expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip.yaml", skipConsumers: false, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0") }, }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - runWhen(t, "enterprise", ">=3.5.0") + tc.runWhen(t) teardown := setup(t) defer teardown(t)