Skip to content

Measure the 95% coverage gate on extension code only - #11

Merged
dimastatz merged 1 commit into
mainfrom
ci/coverage-gate
Oct 10, 2026
Merged

dimastatz merged 1 commit into
mainfrom
ci/coverage-gate

Conversation

@dimastatz

Copy link
Copy Markdown
Owner

The CI job Tests (coverage >= 95%) already fails below 95% (scripts/check-coverage.mjs 95, checking lines, statements, functions and branches). But the total it checked included src/test/: the tests themselves, the fake whisper-flow server and the fake recorder. Test code is nearly 100% covered by definition, so it inflated the number.

Change

.vscode-test.mjs now configures coverage:

  • exclude: ["**/test/**"], so only extension code counts
  • includeAll: true, so a source file that no test imports counts as 0% instead of being left out

The 95% threshold, the CI job and npm run test:coverage are unchanged. CLAUDE.md documents what's measured.

Coverage without test code

Lines Statements Functions Branches
Extension only 98.6% 98.6% 100% 95.7%

All 74 tests pass. Branches have the least headroom, so new code with untested branches will fail the gate. That's the point. The lowest file is workspaceVocabulary.ts at 83% branches (the scan time budget and unreadable-file paths); the gate checks the total, not each file.

Not in this PR: making the check required

main has no branch protection in this repo or in whisper-flow, so a failing coverage job shows a red X but doesn't block merging. Requiring the check is a repository setting (a branch protection rule or ruleset), not a file, so it can't be part of a PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NcUyc2475ugBRGPm7yQMzy

The gate counted src/test/ (tests, the fake server and recorder) toward the
total, which raised it. Exclude test code from coverage and include source
files no test loads, so 95% has to come from the extension itself.

Extension-only coverage today: 98.6% lines and statements, 100% functions,
95.7% branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcUyc2475ugBRGPm7yQMzy
@dimastatz
dimastatz merged commit e196f81 into main Oct 10, 2026
5 checks passed
@dimastatz dimastatz mentioned this pull request Oct 10, 2026
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.

1 participant