Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not share the same ControlPlane in Konnect integration tests #1365

Open
1 task
pmalek opened this issue Aug 21, 2024 · 0 comments
Open
1 task

Do not share the same ControlPlane in Konnect integration tests #1365

pmalek opened this issue Aug 21, 2024 · 0 comments
Labels

Comments

@pmalek
Copy link
Member

pmalek commented Aug 21, 2024

Problem statement

Konnect integration tests share the same ControlPlane in several places

  • default
  • test
    • {
      name: "konnect-runtime-group-name flag - default",
      kongFile: "testdata/sync/026-konnect-rename/default.yaml",
      flags: []string{"--konnect-runtime-group-name", "default"},
      expectedState: utils.KongRawState{
      Services: defaultCPService,
      },
      },
      {
      name: "konnect-control-plane-name flag - default",
      kongFile: "testdata/sync/026-konnect-rename/default.yaml",
      flags: []string{"--konnect-control-plane-name", "default"},
      expectedState: utils.KongRawState{
      Services: defaultCPService,
      },
      },
      {
      name: "konnect-runtime-group-name flag - test",
      runtimeGroupName: "test",
      kongFile: "testdata/sync/026-konnect-rename/test.yaml",
      flags: []string{"--konnect-runtime-group-name", "test"},
      expectedState: utils.KongRawState{
      Services: testCPService,
      },
      },
      {
      name: "konnect-control-plane-name flag - test",
      controlPlaneName: "test",
      kongFile: "testdata/sync/026-konnect-rename/test.yaml",
      flags: []string{"--konnect-control-plane-name", "test"},
      expectedState: utils.KongRawState{
      Services: testCPService,
      },
      },
      {
      name: "konnect.runtime_group_name - default",
      kongFile: "testdata/sync/026-konnect-rename/konnect_default_rg.yaml",
      expectedState: utils.KongRawState{
      Services: defaultCPService,
      },
      },
      {
      name: "konnect.control_plane_name - default",
      kongFile: "testdata/sync/026-konnect-rename/konnect_default_cp.yaml",
      expectedState: utils.KongRawState{
      Services: defaultCPService,
      },
      },
      {
      name: "konnect.runtime_group_name - test",
      runtimeGroupName: "test",
      kongFile: "testdata/sync/026-konnect-rename/konnect_test_rg.yaml",
      expectedState: utils.KongRawState{
      Services: testCPService,
      },
      },
      {
      name: "konnect.control_plane_name - test",
      controlPlaneName: "test",
      kongFile: "testdata/sync/026-konnect-rename/konnect_test_cp.yaml",
      expectedState: utils.KongRawState{
      Services: testCPService,
      },
      },

This might work in isolation but when run on CI this fails when 2 separate workflows runs test against Konnect (using the same token).

Proposed solution

Use something like https://github.com/Kong/sdk-konnect-go/ to create a CP for each test and then remove it in test teardown.

This way we achieve test isolation.

Acceptance criteria

  • Flakes in CI caused by reused Konnect ControlPlanes are not happening anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant