Skip to content

test(cmd): prove the verify exit-code contract#606

Merged
joshua-temple merged 1 commit into
mainfrom
test/verify-exit-code-contract
Jul 16, 2026
Merged

test(cmd): prove the verify exit-code contract#606
joshua-temple merged 1 commit into
mainfrom
test/verify-exit-code-contract

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

The verify exit-code mapping (exitCodeFor: 0=no drift, 1=drift/generic error, 2=operational failure via an ExitCode()-implementing error) had no unit test and no e2e assertion of exit 2, so a regression flipping the mapping would ship silently. The mapping was found correct; this is pure coverage.

  • Unit table (cmd/cascade/exitcode_test.go) asserts each outcome maps to the right code (plain err->1, ErrDrift bare/wrapped->1, coded-2 bare/wrapped->2, coded-3->3) plus a real verify.Run operational error->2; mutation-sensitive (forcing return 1 reddens it).
  • e2e scenario 22 extended with a corrupt-manifest step asserting expect_exit: 2 against the built binary.

Verification: build/test green, 3009 tests, -race on the new tests, e2e schema valid. Pure test-addition.

…d an exit-2 scenario step

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
(cherry picked from commit 1e5e80366de26c3596286024161fe0079d9bd63c)
@joshua-temple joshua-temple merged commit c35b673 into main Jul 16, 2026
21 checks passed
@joshua-temple joshua-temple deleted the test/verify-exit-code-contract branch July 16, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant