Gap Summary
In test/e2e/scenarios/control-plane/sync/scenario.yaml, step 002-sync-with-delete runs a sync that deletes the original control plane (kongctl-e2e-cp) and creates a new one (kongctl-e2e-cp-2). The post-sync verification step (001-002-verify-post-sync) only asserts two things:
kongctl-e2e-cp is absent from the list (length = 0)
kongctl-e2e-cp-2 exists with name: "kongctl-e2e-cp-2"
The overlay (overlays/002-sync-with-delete/control-plane.yaml) declares kongctl-e2e-cp-2 with:
description: "Second Test Control Plane for E2E testing via kongctl"
cluster_type: "CLUSTER_TYPE_CONTROL_PLANE"
Neither description nor cluster_type is asserted in the post-sync verification. A regression where sync creates the control plane with the wrong description, a blank description, or an incorrect cluster type would pass the current test undetected.
This is meaningful because:
- The
sync command is the only declarative operation that exercises resource deletion followed by creation in the same transaction
- Not verifying the fields of the newly created resource means the verification only confirms existence, not correctness
- The analogous
apply scenario (control-plane/apply/scenario.yaml) does verify description and labels after an UPDATE — the sync scenario should meet the same standard
Evidence
Weak post-sync assertion (current):
# test/e2e/scenarios/control-plane/sync/scenario.yaml — step 002-sync-with-delete
- name: 001-002-verify-post-sync
run: ["get", "konnect", "gateway", "control-planes", "-o", "json"]
assertions:
- select: "[?name=='kongctl-e2e-cp']"
expect:
fields:
"length(@)": 0
- select: "[?name=='kongctl-e2e-cp-2'] | [0]"
expect:
fields:
name: "kongctl-e2e-cp-2" # ← name only; description and cluster_type not checked
Overlay that declares the fields (but they're not asserted):
test/e2e/scenarios/control-plane/sync/overlays/002-sync-with-delete/control-plane.yaml
description: "Second Test Control Plane for E2E testing via kongctl"
cluster_type: "CLUSTER_TYPE_CONTROL_PLANE"
Reference for stronger assertions:
test/e2e/scenarios/control-plane/apply/scenario.yaml step 002-001-verify-fields:
asserts description, labels.env, and labels.owner after an apply UPDATE
Proposed Scenario Work
Expand the existing scenario test/e2e/scenarios/control-plane/sync/scenario.yaml.
Replace the 001-002-verify-post-sync command's assertions with:
- name: 001-002-verify-post-sync
run: ["get", "konnect", "gateway", "control-planes", "-o", "json"]
assertions:
- select: "[?name=='kongctl-e2e-cp']"
expect:
fields:
"length(@)": 0
- select: "[?name=='kongctl-e2e-cp-2'] | [0]"
expect:
fields:
name: "kongctl-e2e-cp-2"
description: "Second Test Control Plane for E2E testing via kongctl"
Alternatively, add a follow-up get konnect gateway control-plane kongctl-e2e-cp-2 -o json command in the same step to verify individual fields with more precise JMESPath selects:
- name: 002-002-verify-created-fields
run:
- get
- konnect
- gateway
- control-plane
- kongctl-e2e-cp-2
- -o
- json
assertions:
- select: description
expect:
fields:
"@": "Second Test Control Plane for E2E testing via kongctl"
- select: config.cluster_type
expect:
fields:
"@": "CLUSTER_TYPE_CONTROL_PLANE"
No new testdata files or overlay changes are needed — this is a pure assertion addition.
Acceptance Criteria
Reference Patterns
test/e2e/scenarios/control-plane/apply/scenario.yaml step 002-001-verify-fields — get-by-name with multi-field assertions after an apply mutation
test/e2e/scenarios/control-plane/get/scenario.yaml steps 003-get-by-name and 004-get-by-id — individual field selects using description and config.cluster_type
Generated by E2E Coverage Scanner · ● 2.4M · ◷
Gap Summary
In
test/e2e/scenarios/control-plane/sync/scenario.yaml, step002-sync-with-deleteruns asyncthat deletes the original control plane (kongctl-e2e-cp) and creates a new one (kongctl-e2e-cp-2). The post-sync verification step (001-002-verify-post-sync) only asserts two things:kongctl-e2e-cpis absent from the list (length = 0)kongctl-e2e-cp-2exists withname: "kongctl-e2e-cp-2"The overlay (
overlays/002-sync-with-delete/control-plane.yaml) declareskongctl-e2e-cp-2with:description: "Second Test Control Plane for E2E testing via kongctl"cluster_type: "CLUSTER_TYPE_CONTROL_PLANE"Neither
descriptionnorcluster_typeis asserted in the post-sync verification. A regression where sync creates the control plane with the wrong description, a blank description, or an incorrect cluster type would pass the current test undetected.This is meaningful because:
synccommand is the only declarative operation that exercises resource deletion followed by creation in the same transactionapplyscenario (control-plane/apply/scenario.yaml) does verifydescriptionandlabelsafter an UPDATE — the sync scenario should meet the same standardEvidence
Weak post-sync assertion (current):
Overlay that declares the fields (but they're not asserted):
test/e2e/scenarios/control-plane/sync/overlays/002-sync-with-delete/control-plane.yamldescription: "Second Test Control Plane for E2E testing via kongctl"cluster_type: "CLUSTER_TYPE_CONTROL_PLANE"Reference for stronger assertions:
test/e2e/scenarios/control-plane/apply/scenario.yamlstep002-001-verify-fields:asserts
description,labels.env, andlabels.ownerafter an apply UPDATEProposed Scenario Work
Expand the existing scenario
test/e2e/scenarios/control-plane/sync/scenario.yaml.Replace the
001-002-verify-post-synccommand's assertions with:Alternatively, add a follow-up
get konnect gateway control-plane kongctl-e2e-cp-2 -o jsoncommand in the same step to verify individual fields with more precise JMESPath selects:No new testdata files or overlay changes are needed — this is a pure assertion addition.
Acceptance Criteria
test/e2e/scenarios/control-plane/sync/scenario.yamlstep002-sync-with-deleteincludes at least one assertion on thedescriptionfield ofkongctl-e2e-cp-2after syncconfig.cluster_typeon the newly created resourcekongctl-e2e-cp, presence by name ofkongctl-e2e-cp-2) are preservedReference Patterns
test/e2e/scenarios/control-plane/apply/scenario.yamlstep002-001-verify-fields— get-by-name with multi-field assertions after an apply mutationtest/e2e/scenarios/control-plane/get/scenario.yamlsteps003-get-by-nameand004-get-by-id— individual field selects usingdescriptionandconfig.cluster_type