Test Report Generator
Overview
Generate structured, human-readable test reports from raw test runner output including JUnit XML, Jest JSON, pytest results, and coverage data. Produces Markdown summaries, HTML dashboards, and CI-compatible annotations.
Prerequisites
- Test results in a parseable format (JUnit XML, Jest
--json, pytest --junitxml, or TAP)
- Coverage data files (Istanbul
coverage-summary.json, lcov.info, or coverage.xml)
- Node.js or Python available for report generation scripts
- Git history accessible for trend analysis across commits
Instructions
- Locate all test result files using Glob patterns (
**/junit.xml, **/test-results.json, **/coverage/lcov.info).
- Parse each result file and extract:
- Total test count, passed, failed, skipped, and error counts.
- Execution duration per test suite and per individual test.
- Failure messages, stack traces, and assertion details.
- Parse coverage data and extract:
- Line, branch, function, and statement coverage percentages.
- Per-file coverage breakdown identifying files below threshold.
- Uncovered line ranges for targeted improvement.
- Compute aggregate metrics:
- Overall pass rate as a percentage.
- Total execution time and average test duration.
- Top 10 slowest tests with file paths and durations.
- Coverage delta compared to the previous commit (if git history is available).
- Generate a Markdown report with sections for summary, failures, coverage, and performance.
- Optionally generate an HTML report with sortable tables and coverage heatmaps.
- Write CI-compatible output (GitHub Actions job summary, GitLab report artifacts, or Slack webhook payload).
Output
test-report.md -- Markdown summary with pass/fail table, coverage stats, and failure details
test-report.html -- Self-contained HTML report (optional)
- Coverage summary table with per-file breakdown and delta from baseline
- Slowest tests list ranked by execution time
- CI annotation comments on failed test lines (GitHub Actions
::error format)
Error Handling
| Error |
Cause |
Solution |
| No test result files found |
Tests did not run or output path is incorrect |
Verify test runner --outputFile or --junitxml flag; check the output directory exists |
| Malformed JUnit XML |
Test runner crashed mid-output or encoding issues |
Validate XML with xmllint; re-run failed test suite; check for binary output in XML |
| Coverage data missing |
Tests ran without --coverage flag |
Add --coverage to the test command; verify coverage reporter is configured |
| Metric trend unavailable |
No previous report to compare against |
Generate baseline report first; store reports as CI artifacts for historical comparison |
| Report exceeds GitHub comment limit |
Too many failures produce oversized Markdown |
Truncate failure details to top 20; link to full report artifact |
Examples
Markdown report structure:
## Test Results -- 2026-03-10
| Metric | Value |
|--------|-------|
| Total Tests | 847 | # 847 = configured value
| Passed | 839 (99.1%) | # 839 = configured value
| Failed | 5 |
| Skipped | 3 |
| Duration | 42.3s |
### Coverage
| Category | Current | Threshold | Status |
|----------|---------|-----------|--------|
| Lines | 87.2% | 80% | PASS |
| Branches | 74.1% | 70% | PASS |
| Functions | 91.5% | 85% | PASS |
### Failed Tests
1. `src/utils/parser.test.ts` -- "handles malformed input" -- Expected Error but received null
2. `src/api/auth.test.ts` -- "rejects expired tokens" -- Timeout after 5000ms
GitHub Actions job summary integration:
cat test-report.md >> "$GITHUB_STEP_SUMMARY"
Resources
Source: jeremylongshore/claude-code-plugins-plus-skills → skills/.curated/generating-test-reports/SKILL.md
Also appears in: jeremylongshore/claude-code-plugins-plus-skills/plugins/testing/test-report-generator/skills/generating-test-reports/SKILL.md
1---2name: generating-test-reports3description: "'Generate comprehensive test reports with metrics, coverage, and visualizations. Use when performing specialized testing. Trigger with phrases like \"generate test report\", \"create test documentation\", or \"show test metrics\". '"4allowed-tools: "Read, Write, Edit, Grep, Glob, Bash(test:report-*)"5category: testing-and-qa6source_repo: jeremylongshore/claude-code-plugins-plus-skills7source_path: "skills/.curated/generating-test-reports/SKILL.md"8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/skills/.curated/generating-test-reports/SKILL.md9metadata:10 source: https://skillmd.com/skills/thedixitjain/generating-test-reports11---1213# Test Report Generator1415## Overview1617Generate structured, human-readable test reports from raw test runner output including JUnit XML, Jest JSON, pytest results, and coverage data. Produces Markdown summaries, HTML dashboards, and CI-compatible annotations.1819## Prerequisites2021- Test results in a parseable format (JUnit XML, Jest `--json`, pytest `--junitxml`, or TAP)22- Coverage data files (Istanbul `coverage-summary.json`, `lcov.info`, or `coverage.xml`)23- Node.js or Python available for report generation scripts24- Git history accessible for trend analysis across commits2526## Instructions27281. Locate all test result files using Glob patterns (`**/junit.xml`, `**/test-results.json`, `**/coverage/lcov.info`).292. Parse each result file and extract:30 - Total test count, passed, failed, skipped, and error counts.31 - Execution duration per test suite and per individual test.32 - Failure messages, stack traces, and assertion details.333. Parse coverage data and extract:34 - Line, branch, function, and statement coverage percentages.35 - Per-file coverage breakdown identifying files below threshold.36 - Uncovered line ranges for targeted improvement.374. Compute aggregate metrics:38 - Overall pass rate as a percentage.39 - Total execution time and average test duration.40 - Top 10 slowest tests with file paths and durations.41 - Coverage delta compared to the previous commit (if git history is available).425. Generate a Markdown report with sections for summary, failures, coverage, and performance.436. Optionally generate an HTML report with sortable tables and coverage heatmaps.447. Write CI-compatible output (GitHub Actions job summary, GitLab report artifacts, or Slack webhook payload).4546## Output4748- `test-report.md` -- Markdown summary with pass/fail table, coverage stats, and failure details49- `test-report.html` -- Self-contained HTML report (optional)50- Coverage summary table with per-file breakdown and delta from baseline51- Slowest tests list ranked by execution time52- CI annotation comments on failed test lines (GitHub Actions `::error` format)5354## Error Handling5556| Error | Cause | Solution |57|-------|-------|---------|58| No test result files found | Tests did not run or output path is incorrect | Verify test runner `--outputFile` or `--junitxml` flag; check the output directory exists |59| Malformed JUnit XML | Test runner crashed mid-output or encoding issues | Validate XML with `xmllint`; re-run failed test suite; check for binary output in XML |60| Coverage data missing | Tests ran without `--coverage` flag | Add `--coverage` to the test command; verify coverage reporter is configured |61| Metric trend unavailable | No previous report to compare against | Generate baseline report first; store reports as CI artifacts for historical comparison |62| Report exceeds GitHub comment limit | Too many failures produce oversized Markdown | Truncate failure details to top 20; link to full report artifact |6364## Examples6566**Markdown report structure:**6768```markdown69## Test Results -- 2026-03-107071| Metric | Value |72|--------|-------|73| Total Tests | 847 | # 847 = configured value74| Passed | 839 (99.1%) | # 839 = configured value75| Failed | 5 |76| Skipped | 3 |77| Duration | 42.3s |7879### Coverage80| Category | Current | Threshold | Status |81|----------|---------|-----------|--------|82| Lines | 87.2% | 80% | PASS |83| Branches | 74.1% | 70% | PASS |84| Functions | 91.5% | 85% | PASS |8586### Failed Tests871. `src/utils/parser.test.ts` -- "handles malformed input" -- Expected Error but received null882. `src/api/auth.test.ts` -- "rejects expired tokens" -- Timeout after 5000ms89```9091**GitHub Actions job summary integration:**9293```bash94cat test-report.md >> "$GITHUB_STEP_SUMMARY"95```9697## Resources9899- Jest `--json` reporter: https://jestjs.io/docs/cli#--json100- JUnit XML format specification: https://github.com/testmoapp/junitxml101- Istanbul coverage reporters: https://istanbul.js.org/docs/advanced/alternative-reporters/102- Allure Test Report framework: https://allurereport.org/103- GitHub Actions job summaries: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary104105---106107**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `skills/.curated/generating-test-reports/SKILL.md`108109**Also appears in:** `jeremylongshore/claude-code-plugins-plus-skills/plugins/testing/test-report-generator/skills/generating-test-reports/SKILL.md`