2.0 KiB
2.0 KiB
| description | argument-hint | allowed-tools |
|---|---|---|
| Fix QA test failures | <feature-slug> | Bash, Read, Write, Edit, Glob, Grep, Task |
Fix QA failures for feature: $ARGUMENTS
Instructions
1. Load QA Results
Read .sdlc/features/$ARGUMENTS/qa-results.md to get the full test results.
2. Parse Failed Scenarios
Collect all scenarios with status FAIL. For each failure, note:
- Scenario ID and description
- Expected vs actual behavior
- Error output or evidence
3. Diagnose Each Failure
For each failed scenario:
- Read the test code or manual steps that failed
- Read the production code being tested
- Determine if the issue is in the implementation, the test, or the test data
4. Fix Implementation Issues
If the failure is due to incorrect implementation:
- Fix the production code
- Run the specific failing test to confirm the fix
- Run the full test suite to ensure no regressions:
go test ./... 2>/dev/null || true
5. Fix Test Issues
If the failure is due to an incorrect test expectation:
- Verify the test expectation against the spec
- If the spec supports the test, fix the implementation (not the test)
- If the test expectation was wrong, fix the test and document why
6. Re-run All Failed Scenarios
After all fixes, re-execute every previously failed scenario and confirm PASS.
7. Update QA Results
Update .sdlc/features/$ARGUMENTS/qa-results.md:
- Change FAIL to PASS for fixed scenarios
- Add a remediation note explaining what was fixed
- Verify the overall status (PASS only if all scenarios pass)
8. Report
Summarize: failures fixed, root causes, regression status (all previously passing tests still pass).
Critical Rules
- ALWAYS re-run failed tests after fixing -- verify with evidence
- NEVER mark a test as passing without actually running it
- NEVER fix tests to match broken behavior -- fix the implementation
- ALWAYS keep passing tests passing -- no regressions
- ALWAYS update the QA results document with resolution details