Add PTY-based end-to-end CLI testing infrastructure
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16
- Forks
- 3
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 121
Description
Add infrastructure for testing interactive CLI features using pseudo-terminal (PTY) simulation.
Context
Currently, interactive prompts (jp_inquire, inquire) require a real TTY and cannot be tested automatically. While we can use dependency injection to test the logic around prompts, true end-to-end testing of the CLI's interactive behavior requires simulating terminal input/output.
Libraries like portable-pty or expectrl can create pseudo-terminals that allow injecting keystrokes and capturing output, enabling tests like:
- Interrupt handling (Ctrl+C menus)
- Tool permission prompts
- Multi-select dialogs
- Editor integration
Alternatives
Dependency injection at the prompt level (implemented separately) covers unit testing of prompt-adjacent logic but doesn't verify the actual terminal rendering or keystroke handling.
Proposed Implementation
- Evaluate
portable-ptyvsexpectrlfor our needs - Create a test harness that spawns
jpcommands in a PTY - Add helper functions for sending keystrokes and matching output
- Write e2e tests for critical interactive flows
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by evaluating portable-pty and expectrl for spawning jp commands and simulating terminal input/output. Build a PTY test harness with helpers for keystrokes and output matching, then add end-to-end coverage for interrupt handling, permission prompts, multi-select dialogs, and editor integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100