The diff/command-coverage scenario at
test/e2e/scenarios/diff/command-coverage/scenario.yaml tests all three
diff modes (apply, delete, sync) and plan-file rendering, but every
command uses -o json. There are no text-format output steps anywhere
in this scenario.
Why this matters
PR #2201 (closing #2200) added recursive nested-field rendering in
displayNestedFieldChange and displayDiffChange
(internal/cmd/root/products/konnect/declarative/diff_values.go).
That fix has unit test coverage in declarative_test.go but no E2E
regression coverage for the text output path.
The overlay at overlays/003-diff/config.yaml already includes
changes that exercise the nested rendering code paths:
- Array-of-objects diff: AI gateway
proxy_urls[0].host changes
from diff-ai-gateway.example.com to
diff-ai-gateway-updated.example.com
- Map diff: AI gateway
labels.owner changes from platform to
platform-eng
- Scalar diffs: portal
display_name, control plane description,
team description, auth strategy display_name, DCR provider
issuer
These nested changes are validated structurally via JSON assertions but
the text rendering of those same changes is never tested.
Suggested approach
Expand the existing 003-diff-with-modifications step by adding text
output commands alongside the JSON ones. For example, after
000-diff-apply-mode (JSON), add a text-mode step:
- name: 010-diff-apply-mode-text
outputFormat: text
parseAs: raw
run:
- diff
- -f
- "{{ .workdir }}/config.yaml"
- --mode
- apply
assertions:
- select: stdout
expect:
fields:
"contains(@, 'will be updated')": true
"contains(@, 'platform → platform-eng')": true
"contains(@, 'Plan:')": true
Reference patterns for text output testing exist in:
test/e2e/scenarios/plan/sync-workflow/scenario.yaml step
001-diff-plan-text (uses outputFormat: text, parseAs: raw,
contains(@, ...) assertions)
test/e2e/scenarios/plan/apply-workflow/scenario.yaml step
001-diff-plan-text
Key assertions to include:
- Summary line (
Plan: N to add, N to change, N to destroy)
- At least one nested map field change (labels.owner)
- At least one resource-level update header (
will be updated)
This would provide regression coverage for the text diff rendering
without creating a new scenario — the test data and overlay are already
in place.
Generated by E2E Coverage Scanner · opus46 · 547 AIC · ⌖ 29.3 AIC · ⊞ 6.7K · ◷
The
diff/command-coveragescenario attest/e2e/scenarios/diff/command-coverage/scenario.yamltests all threediff modes (apply, delete, sync) and plan-file rendering, but every
command uses
-o json. There are no text-format output steps anywherein this scenario.
Why this matters
PR #2201 (closing #2200) added recursive nested-field rendering in
displayNestedFieldChangeanddisplayDiffChange(
internal/cmd/root/products/konnect/declarative/diff_values.go).That fix has unit test coverage in
declarative_test.gobut no E2Eregression coverage for the text output path.
The overlay at
overlays/003-diff/config.yamlalready includeschanges that exercise the nested rendering code paths:
proxy_urls[0].hostchangesfrom
diff-ai-gateway.example.comtodiff-ai-gateway-updated.example.comlabels.ownerchanges fromplatformtoplatform-engdisplay_name, control planedescription,team
description, auth strategydisplay_name, DCR providerissuerThese nested changes are validated structurally via JSON assertions but
the text rendering of those same changes is never tested.
Suggested approach
Expand the existing
003-diff-with-modificationsstep by adding textoutput commands alongside the JSON ones. For example, after
000-diff-apply-mode(JSON), add a text-mode step:Reference patterns for text output testing exist in:
test/e2e/scenarios/plan/sync-workflow/scenario.yamlstep001-diff-plan-text(usesoutputFormat: text,parseAs: raw,contains(@, ...)assertions)test/e2e/scenarios/plan/apply-workflow/scenario.yamlstep001-diff-plan-textKey assertions to include:
Plan: N to add, N to change, N to destroy)will be updated)This would provide regression coverage for the text diff rendering
without creating a new scenario — the test data and overlay are already
in place.