Code coverage threshold#145
Open
gloskull wants to merge 2 commits into
Open
Conversation
…ds-in-ci Add CI coverage threshold gate
Contributor
|
resolve conflicts @gloskull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Enforce a global unit-test coverage quality gate in the frontend pipeline so regressions are caught before E2E/browser tests run.
Provide reproducible local and CI coverage runs with Vitest's V8 provider and a documented runbook for contributors and reviewers.
Description
Add test:coverage and test:coverage:ci scripts to package.json that run Vitest with V8 coverage and standard reporters (text, json-summary, lcov).
Update vitest.config.ts to configure coverage (provider v8, include/exclude patterns, reporters, ./coverage output, and global thresholds: lines/statements/functions 80% and branches 70%).
Add a unit-coverage job to .github/workflows/frontend-ci.yml that installs the matching @vitest/coverage-v8 provider, runs the coverage gate, uploads coverage/ as an artifact, and makes E2E tests depend on the coverage job.
Add docs/coverage-ci.md documenting the architecture, thresholds, runbook, and monitoring/branch-protection guidance.
Testing
npx tsc --noEmit passed against the updated TypeScript configuration.
npm run lint was executed and failed due to pre-existing unused-variable lint errors in src/components/map/AssetHeatmapLayer.tsx.
npm run test executed the unit test suite and reported most tests passing while leaving 3 failing tests (failures originate from existing test expectations and a crypto.subtle.digest usage in src/services/keyCache.ts).
npm run test:coverage:ci could not be run in this environment because installing @vitest/coverage-v8@4.1.9 from the npm registry is blocked by the environment (install attempts returned 403 Forbidden).
Closes #130