Skip to content

Add test coverage CI with PR comments and job summaries#36

Merged
Mossaka merged 4 commits intomainfrom
copilot/add-ci-test-coverage-report
Oct 30, 2025
Merged

Add test coverage CI with PR comments and job summaries#36
Mossaka merged 4 commits intomainfrom
copilot/add-ci-test-coverage-report

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 30, 2025

Adds automated test coverage reporting to CI pipeline. Coverage metrics are posted as PR comments and displayed in GitHub Actions job summaries.

Implementation

  • Workflow (.github/workflows/test-coverage.yml)

    • Runs npm run test:coverage on PRs and pushes to main
    • Parses coverage-summary.json to extract metrics
    • Posts/updates PR comment with coverage table (avoids spam)
    • Writes to $GITHUB_STEP_SUMMARY for job output
    • Uploads HTML reports as artifacts (30-day retention)
  • Permissions

    • contents: read, pull-requests: write, checks: write
  • Documentation

    • Updated TESTING.md with CI coverage reporting section
    • Updated CONTRIBUTING.md to reference automated coverage reports

Example Output

## Test Coverage Report

| Metric | Coverage | Covered/Total |
|--------|----------|---------------|
| **Lines** | 45.89% | 218/475 |
| **Statements** | 45.99% | 224/487 |
| **Functions** | 51.78% | 29/56 |
| **Branches** | 33.58% | 44/131 |

<details>
<summary>Coverage Thresholds</summary>

Configured thresholds: Lines 38%, Statements 38%, Functions 35%, Branches 30%
</details>

Comment updates on subsequent pushes rather than creating new comments.

Original prompt

add the test coverage as a ci pipeline and the ci should report the coverage for each PR as a comment for npm run test:coverage. figure out the necessary permissions for the ci to output as a summary and make a comment to the PR.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 30, 2025 19:16
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Mossaka Mossaka marked this pull request as ready for review October 30, 2025 19:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 30, 2025

Test Coverage Report

Metric Coverage Covered/Total
Lines 45.89% 218/475
Statements 45.79% 223/487
Functions 51.78% 29/56
Branches 32.82% 43/131
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

Copilot AI changed the title [WIP] Add CI pipeline for test coverage reporting Add test coverage CI with PR comments and job summaries Oct 30, 2025
Copilot AI requested a review from Mossaka October 30, 2025 19:25
@Mossaka
Copy link
Copy Markdown
Collaborator

Mossaka commented Oct 30, 2025

@copilot remove the visual indicators since we haven't established a baseline yet

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 30, 2025

@copilot remove the visual indicators since we haven't established a baseline yet

Done. Removed all visual indicators (emojis) from the coverage report in commit fe9ba8d. The report now shows coverage metrics without status emojis.

@Mossaka Mossaka merged commit ef49284 into main Oct 30, 2025
8 checks passed
@Mossaka Mossaka deleted the copilot/add-ci-test-coverage-report branch October 30, 2025 20:33
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.

2 participants