Skip to content

test(cli): cover the picker's failed listings, Esc, and signals - #57

Merged
thebrandonlucas merged 1 commit into
feat/cli-interactive-pickersfrom
test/cli-picker-failures
Oct 20, 2026
Merged

thebrandonlucas merged 1 commit into
feat/cli-interactive-pickersfrom
test/cli-picker-failures

Conversation

@thebrandonlucas

@thebrandonlucas thebrandonlucas commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Stack: master ← #20 ← #22 ← #57 ← #24 ← #19 ← #26 ← #27 ← #28 ← #29 ← #30 ← #55. Rebased onto master (#53, #56) on 2026-10-19.

Tests for the picker paths in #22 that had none. They are split from #22 to keep that PR under 1,000 changed lines. Test-only.

Case Expected
Organization listing fails (HTTP 500) Exit 3 with the auth error; no "Organization:" prompt
Organization token exchange rejected (invalid_grant) Exit 3 with that error
Environment listing fails Exit 3 with that error
Wallet listing fails (HTTP 403) Exit 3 with that error
Two --env values Exit 2 before any listing
Esc at the organization picker Exit 2, --org is required
Esc at the environment picker Exit 2, "Exactly one --env is required"; the hint still names the organization picked first
Real SIGINT while the picker is open Exit 130; PickerScreen writes \x1b[?2004l\x1b[?25h and terminal modes are restored

A failed pick never falls back to the missing-scope error and never prints the "Next time" hint. on_a_terminal now sends SIGINT for a step with no keys; its signature is unchanged. With the PickerScreen guard removed, the SIGINT test fails.

Checks

On f266c25:

  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata: pass.
  • cargo test --locked: 93 unit and 69 integration tests pass. VOLTAGE_BLESS=1 cargo test --locked leaves the tree clean.
  • python3 scripts/check-coverage.py: pass.
  • CRAP (scripts/crap-report.sh): no function at or above 20. Highest is api::wait_for_payment at 19.66, unchanged from or lower than master (19.66).
  • Skill review: voltage-pr-review and the voltage-backend-engineering Rust checklist, against the stack base. Findings are fixed in this commit.

Not run: the staging and live tutorials, which need credentials.

Each listing or exchange that fails during a pick now has a test: the
organization listing, the organization token exchange, the environment
listing, and the wallet listing. Each ends the command with its own
error (exit 3), never the missing-scope error, with no "Next time" hint
and the terminal modes restored. Two --env values exit 2 before any
listing.

Esc at the organization or environment picker keeps the missing-scope
error, and its hint still names the organization picked first. A real
SIGINT while the picker is open exits 130, and the PickerScreen guard
restores bracketed paste and the cursor; on_a_terminal sends SIGINT for
a step with no keys.
@thebrandonlucas thebrandonlucas added the human review wanted CI passes; ready for a human reviewer label Oct 20, 2026
@tee8z tee8z assigned tee8z and thebrandonlucas and unassigned tee8z Oct 20, 2026
@thebrandonlucas
thebrandonlucas merged commit 60159b8 into master Oct 20, 2026
6 checks passed
@thebrandonlucas
thebrandonlucas deleted the test/cli-picker-failures branch October 20, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human review wanted CI passes; ready for a human reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants