Skip to content

[e2e-scan] Add text output steps to diff/command-coverage E2E scenario #2224

Description

@github-actions

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:

  1. Summary line (Plan: N to add, N to change, N to destroy)
  2. At least one nested map field change (labels.owner)
  3. 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 ·

  • expires on Oct 18, 2026, 5:02 AM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    automatione2eIssue related to the e2e tests and testing frameworkenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions