Test the CLI through cmd.Run, capturing the (stdout, stderr, exit code) triple - #62
Open
MPV wants to merge 1 commit into
Open
Test the CLI through cmd.Run, capturing the (stdout, stderr, exit code) triple#62MPV wants to merge 1 commit into
MPV wants to merge 1 commit into
Conversation
MPV
force-pushed
the
claude/e2e-approvals-triple
branch
2 times, most recently
from
August 2, 2026 07:26
fbed092 to
e9001a9
Compare
MPV
force-pushed
the
claude/e2e-approvals-triple
branch
from
August 2, 2026 08:05
e9001a9 to
f5f9422
Compare
MPV
force-pushed
the
claude/e2e-approvals-triple
branch
2 times, most recently
from
August 2, 2026 08:18
cb6bc2f to
c5bbc9a
Compare
Route the whole behavioral golden suite through cmd.Run — the real entry point (#63) — via one verify(args, stdin) helper, and approve each scenario's (stdout, stderr, exit code) triple as three golden files. Every test now exercises the actual CLI seam rather than the internal processor.ProcessFile, so the goldens capture exactly what the tool emits (the trailing newline on stdout, the "error:" prefix on stderr, and the exit code). Granular, per-layer coverage stays in the k8s/yamlparser/processor/fileutil unit tests; this package is the behavioral golden layer. Scenarios: the seven workload kinds, a Service (error), a multi-document file, plus the CLI-only cases stdin, a missing path, and no-args usage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
MPV
force-pushed
the
claude/e2e-approvals-triple
branch
from
August 3, 2026 08:25
c5bbc9a to
59e4fe7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The whole behavioral golden suite in
approvals/now runs throughcmd.Run— the real CLI entry point (#63) — via a singleverify(args, stdin)helper, and approves each scenario's (stdout, stderr, exit code) triple as three per-stream golden files. In-process (no subprocess/go build), all inapprovals/kir_test.go, no new dependency.Why one seam
Runis the actual public contract. Testing every scenario through it means:error:prefix on stderr, and the exit code — not a processor-level approximation;Granular, per-layer localization stays where it belongs — the
k8s/yamlparser/processor/fileutilunit tests. This package is the behavioral golden layer.What changed from the processor-level version
exitcodegoldens (the workload/error/multi scenarios), all0.fmt.Fprintlnvsstrings.Join).TestError's stderr gains the CLI'serror:log prefix.Scenarios
Seven workload kinds, a Service (error), a multi-document file, and the CLI-only cases: stdin (
-), a missing path, and no-args usage.Scope
Standalone, additive, off master.
-race/vet/gofmt/go mod tidyall clean. Supersedes the testscript track (#61) if you prefer staying approvals-native.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC