Skip to content

Comments

Add V8 test coverage reporting to CI workflows#18

Merged
a-25 merged 2 commits intomainfrom
copilot/fix-17
Aug 25, 2025
Merged

Add V8 test coverage reporting to CI workflows#18
a-25 merged 2 commits intomainfrom
copilot/fix-17

Conversation

Copy link
Contributor

Copilot AI commented Aug 25, 2025

This PR adds comprehensive test coverage reporting using V8 coverage to all existing GitHub Actions workflows. The coverage reports are displayed directly in the CI job logs without creating artifacts, providing immediate visibility into code coverage metrics.

Changes Made

Dependencies and Scripts

  • Added @vitest/coverage-v8 as a dev dependency
  • Added npm run test:coverage script that runs tests with coverage analysis

Enhanced Coverage Configuration

  • Updated vitest.config.ts with improved coverage exclusions for test files, node_modules, and build artifacts
  • Configured V8 provider with both text and HTML reporters (HTML files are gitignored)

CI Workflow Updates

All three workflows now include coverage reporting:

  • CI workflow (ci.yml): Shows coverage during main branch and PR builds
  • PR check workflow (pr-check.yml): Includes coverage validation in PR status checks
  • Release workflow (release.yml): Validates coverage before creating release artifacts

Coverage Results

The implementation shows approximately 40% overall coverage with detailed breakdown:

  • Core functionality (src/core/): ~61% coverage
  • Test utilities: 100% coverage (e.g., spawnAndCollectOutput.ts)
  • Server startup files: 0% coverage (expected for main server entry points)

Benefits

  • Immediate visibility: Coverage metrics appear directly in CI job logs
  • No artifacts: Coverage data doesn't bloat the repository or create unnecessary files
  • Comprehensive reporting: All workflows now provide coverage insights
  • Backward compatibility: Existing npm test continues to work without coverage overhead

The coverage reporting helps identify areas that need additional testing while maintaining the project's existing workflow patterns.

Fixes #17.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: a-25 <6087455+a-25@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test coverage Add V8 test coverage reporting to CI workflows Aug 25, 2025
Copilot AI requested a review from a-25 August 25, 2025 20:53
@a-25 a-25 marked this pull request as ready for review August 25, 2025 21:03
Copilot AI review requested due to automatic review settings August 25, 2025 21:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage reporting using V8 coverage to all GitHub Actions workflows. The implementation provides immediate visibility into code coverage metrics through CI job logs without creating repository artifacts.

Key changes include:

  • Addition of V8 coverage dependency and npm script for coverage analysis
  • Enhanced Vitest configuration with improved coverage exclusions
  • Integration of coverage reporting into all three CI workflows (main CI, PR checks, and release validation)

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.config.ts Enhanced coverage configuration with V8 provider and exclusion patterns for test files and build artifacts
package.json Added @vitest/coverage-v8 dependency and test:coverage npm script
.github/workflows/release.yml Updated release workflow to run tests with coverage validation
.github/workflows/pr-check.yml Modified PR check workflow to include coverage reporting in status checks
.github/workflows/ci.yml Enhanced CI workflow with coverage analysis and reporting

"src/__tests__/**",
"**/*.test.ts",
"**/node_modules/**",
"dist/**"
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

The exclude pattern "**/*.test.ts" is redundant since "src/__tests__/**" already covers the test directory structure mentioned in the coding guidelines. According to the project structure, test files are located in src/__tests__/**/*.test.ts, so the first exclusion pattern already handles all test files.

Copilot uses AI. Check for mistakes.
@a-25 a-25 merged commit bf44390 into main Aug 25, 2025
4 checks passed
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 test coverage

2 participants