story-kit: queue 128_story_test_coverage_worktree_rs for QA

This commit is contained in:
Dave
2026-02-24 00:10:54 +00:00
parent 31ae7f63d8
commit 3805d69a3f

View File

@@ -0,0 +1,28 @@
---
name: "Add test coverage for worktree.rs (65% -> 80%+)"
---
# Story 128: Add test coverage for worktree.rs
Currently at 65% line coverage (330 lines, 124 missed). Worktree management is core infrastructure — creating, removing, and managing git worktrees for agent isolation.
## What to test
- `worktree_path` construction
- `create_worktree` — branch naming, git worktree add, setup command execution
- `remove_worktree_by_story_id` — cleanup, branch deletion
- Setup command runner (pnpm install, pnpm build, cargo check)
- Error paths: git failures, setup failures, missing directories
- Edge cases: worktree already exists, branch already exists
## Notes
- Use temp git repos for integration tests
- Mock expensive operations (pnpm install, cargo check) where possible
- The setup command failure path is especially important (this was the root cause of bug 118)
## Acceptance Criteria
- [ ] Line coverage for `worktree.rs` reaches 80%+
- [ ] Tests pass with `cargo test`
- [ ] `cargo clippy` clean