Skip to content

feat(ci): report test coverage on PRs#1437

Open
dawsontoth wants to merge 1 commit into
stagefrom
claude/test-coverage-gha-output-afd415
Open

feat(ci): report test coverage on PRs#1437
dawsontoth wants to merge 1 commit into
stagefrom
claude/test-coverage-gha-output-afd415

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

Summary

Surfaces vitest coverage in CI, outside of Sonar (closes #1319):

  • Verify PR now runs pnpm test:coverage instead of pnpm test.
  • A new Report coverage step (davelosert/vitest-coverage-report-action, pinned to the v2.12.1 commit SHA like the other actions) posts a sticky PR comment with the coverage table — statements/branches/functions/lines plus per-file detail for files changed in the PR — and writes the same table to the workflow job summary.
  • vitest.config.ts adds the json-summary and json coverage reporters the action reads (lcov stays for Sonar), plus reportOnFailure: true so coverage still posts when tests fail (the report step runs if: always()).
  • Adds an explicit permissions block (contents: read, pull-requests: write) so the action can create/update its comment.

Notes

  • Verified locally: pnpm test:coverage produces coverage/coverage-summary.json and coverage/coverage-final.json, the action's default input paths; /coverage is already gitignored.
  • The PR comment requires a same-repo PR (fork PRs would still get the job summary, just no comment).
  • This very PR should demonstrate the comment once the workflow runs.

🤖 Generated with Claude Code

Run vitest with coverage in Verify PR and surface the results with
vitest-coverage-report-action: a sticky PR comment plus the workflow job
summary, with per-file detail for changed files. Adds the json-summary
and json coverage reporters the action reads (lcov stays for Sonar) and
reportOnFailure so coverage still posts when tests fail.

Closes #1319

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dawsontoth dawsontoth requested a review from a team as a code owner July 9, 2026 15:48

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Vitest configuration in vitest.config.ts to include json-summary and json coverage reporters, and enables reportOnFailure to ensure coverage reports are generated even when tests fail. There are no review comments, and I have no feedback to provide.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 46.95% 4393 / 9356
🔵 Statements 47.3% 4687 / 9909
🔵 Functions 38.99% 1049 / 2690
🔵 Branches 39.27% 2852 / 7262
File CoverageNo changed files found.
Generated in workflow #1414 for commit 9c3d2e5 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code coverage reporting in Studio outside of Sonar

1 participant