Skip to content

Code coverage threshold#145

Open
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Code-Coverage-Threshold
Open

Code coverage threshold#145
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Code-Coverage-Threshold

Conversation

@gloskull

Copy link
Copy Markdown
Contributor

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

@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

2 similar comments
@JerryIdoko

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

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.

Code Coverage Threshold Enforcement in CI Pipeline

3 participants