Claude-skill-registry extract-test-failures
Extract and summarize test failures from logs. Use to quickly understand what tests failed and why.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/extract-test-failures" ~/.claude/skills/majiayu000-claude-skill-registry-extract-test-failures && rm -rf "$T"
manifest:
skills/data/extract-test-failures/SKILL.mdsource content
Extract and Summarize Test Failures
Parse test logs to extract failure information and create summary.
When to Use
- CI test run failed, need to understand failures
- Large test suite with many failures, need summary
- Categorizing failures by type (assertion, runtime, timeout)
- Creating PR review comments about failures
- Tracking which tests are failing over time
Quick Reference
# Extract failed test names grep "FAILED" test_output.log # Get failure details with context grep -A 10 "FAILED\|Error\|AssertionError" test_output.log # Count failures by type grep "FAILED\|AssertionError\|ValueError\|TypeError" test_output.log | sort | uniq -c # Extract test summary line tail -20 test_output.log | grep -E "passed|failed|error" # Get specific failure info grep -B 5 "AssertionError" test_output.log | head -50
Failure Extraction Workflow
- Collect log: Get test output from CI or local run
- Find failures: Extract FAILED markers and error types
- Group by type: Categorize assertion vs runtime vs timeout
- Extract details: Get error messages and stack traces
- Count totals: Summary of how many failures
- Identify patterns: Common failure causes
- Summarize: Create concise failure report
Failure Categories
Assertion Failures:
- Expected value check failedAssertionError
- Values don't matchassert_equal()
- Condition not trueassert_true()- Fix: Check test logic and expected values
Type/Attribute Errors:
- Missing method/attributeAttributeError
- Wrong argument typeTypeError
- Invalid value for operationValueError- Fix: Check code syntax and types
Runtime Errors:
- Out of bounds accessIndexError
- Dictionary key not foundKeyError
- Division by zeroZeroDivisionError- Fix: Check boundary conditions
Timeout/Hanging:
- Test takes too long
- Infinite loop or deadlock
- Resource exhaustion
- Fix: Optimize or add timeout
Output Format
Report failures with:
- Total Failures - Count and percentage of total tests
- Failure Summary - By type (assertion, runtime, timeout, other)
- Failed Tests - List of test names that failed
- Top Issues - Most common failure patterns
- Error Messages - Representative error snippets
- Recommendations - Which tests to focus on first
Error Handling
| Problem | Solution |
|---|---|
| No FAILED markers | Check log format, may use different pattern |
| Truncated output | Get full log from artifacts instead of view |
| Mixed output types | Filter by log level or timestamp |
| Encoding issues | Convert to UTF-8 first |
| Very large logs | Split and process in chunks |
References
- See test-diff-analyzer for identifying flaky tests
- See analyze-ci-failure-logs for CI-specific failures
- See generate-fix-suggestions for automated fixes