test-fixing
运行测试并利用智能错误分组系统性地修复所有失败的测试。适用于用户要求修复失败测试、提及测试失败、运行测试套件出现失败,或请求让测试通过的情况。
name:test-fixingdescription:Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass.
Test Fixing
Systematically identify and fix all failing tests using smart grouping strategies.
When to Use
Systematic Approach
1. Initial Test Run
Run make test to identify all failing tests.
Analyze output for:
2. Smart Error Grouping
Group similar failures by:
Prioritize groups by:
3. Systematic Fixing Process
For each group (starting with highest impact):
- Read relevant code
- Check recent changes with git diff
- Understand the error pattern
- Use Edit tool for code changes
- Follow project conventions (see CLAUDE.md)
- Make minimal, focused changes
- Run subset of tests for this group
- Use pytest markers or file patterns:
uv run pytest tests/path/to/test_file.py -v
uv run pytest -k "pattern" -v- Ensure group passes before moving on
4. Fix Order Strategy
Infrastructure first:
Then API changes:
Finally, logic issues:
5. Final Verification
After all groups fixed:
make testBest Practices
git diff to understand recent changesExample Workflow
User: "The tests are failing after my refactor"
make test → 15 failures identified- 8 ImportErrors (module renamed)
- 5 AttributeErrors (function signature changed)
- 2 AssertionErrors (logic bugs)