story-kit: create 124_story_test_coverage_llm_providers_claude_code_rs
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: "Add test coverage for llm/providers/claude_code.rs (54% -> 75%+)"
|
||||
---
|
||||
|
||||
# Story 124: Add test coverage for llm/providers/claude_code.rs
|
||||
|
||||
Currently at 54% line coverage (496 lines, 259 missed). The Claude Code provider spawns `claude` CLI processes and manages their I/O.
|
||||
|
||||
## What to test
|
||||
|
||||
- Command argument construction (model, max-turns, budget, system prompt, append flags)
|
||||
- Output parsing (streaming JSON events from claude CLI)
|
||||
- Session ID extraction
|
||||
- Process lifecycle management
|
||||
- Error handling (process crash, invalid output, timeout)
|
||||
- Permission request/response flow
|
||||
|
||||
## Notes
|
||||
|
||||
- Mock the process spawning rather than running real `claude` commands
|
||||
- Test the output parsing logic with sample JSON event streams
|
||||
- The argument construction logic is especially testable as pure functions
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] Line coverage for `llm/providers/claude_code.rs` reaches 75%+
|
||||
- [ ] Tests pass with `cargo test`
|
||||
- [ ] `cargo clippy` clean
|
||||
Reference in New Issue
Block a user