Skip to content

Fail npm run cov if aggregate coverage falls under 100% - #1605

Merged
sergey-shandar merged 4 commits into
mainfrom
claude/cov-100-percent-gate
Aug 16, 2026
Merged

Fail npm run cov if aggregate coverage falls under 100%#1605
sergey-shandar merged 4 commits into
mainfrom
claude/cov-100-percent-gate

Conversation

@sergey-shandar

@sergey-shandar sergey-shandar commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

No change to .github/workflows/ci.yml or the CI generator (fjs/ci/) is needed: the generated node26 job already runs npm run cov as a plain step, so the new thresholds take effect purely from package.json. Verified with npm run ci-update that nothing else drifts.

Sequencing note (resolved): this PR was opened before #1603 (the js/tokenizer coverage fix) merged, so its own CI initially failed at exactly the gate this PR adds — confirming the gate works. #1603 has since merged; after rebasing, npm run cov exits 0 locally with 100.00 | 100.00 | 100.00 aggregate.

Test plan

  • npx tsc --noEmit
  • npm run ci-updategit status shows only package.json changed (no generated-file drift)
  • node ./fjs/module.mjs t → 2882 pass, 0 fail
  • npm run cov → exits 0, 100.00 | 100.00 | 100.00 aggregate (after rebasing onto main with tokenizer: bring back to 100% coverage #1603)

Changelog

  • ci: npm run cov now fails the build if aggregate line, branch, or function coverage falls under 100%, instead of only reporting the numbers

🤖 Generated with Claude Code

node --test supports --test-coverage-lines/--test-coverage-branches/
--test-coverage-functions as minimum-threshold flags: node exits
non-zero if the aggregate percentage across included files falls
below the given value. cov previously only reported numbers; CI's
node26 job ran it but nothing failed the build on a regression, which
is how the coverage gaps in #1596/#1597/#1600 slipped through
unnoticed until a repo-wide sweep found them.

Sets all three thresholds to 100, matching AGENTS.md's existing
100%-coverage requirement for new code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmWCv5YGRXToq26xPoSXjX
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmWCv5YGRXToq26xPoSXjX
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
functionalscript 6ca3c02 Commit Preview URL

Branch Preview URL
Aug 16 2026, 03:11 AM

Copy link
Copy Markdown
Contributor Author

The node26 failure here (run) is the expected/documented one from the PR description — npm run cov failing because fjs/js/tokenizer/module.f.mjs is still at 97.99% functions pending #1603. Not fixing it here; waiting for #1603 to merge, then will rebase this branch and confirm CI goes green.


Generated by Claude Code

@o2alexanderfedin o2alexanderfedin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The gate demonstrably fails, which is the thing worth checking here — a threshold that never trips is worse than none. At this head npm run cov exits 0 with all files | 100.00 | 100.00 | 100.00. Appending an exported, never-called two-line function with a branch to fjs/types/string/module.f.mjs made the same command exit 1, aggregate dropping to 99.99 lines / 99.95 functions. File restored, tree clean.

Semantics confirmed: the threshold compares against the aggregate "all files" row (one file at 95% still tripped it), and Node's --help describes --test-coverage-lines as a minimum threshold. Only the node26 job (26.7.0) runs npm run covnode22/node24 run bare node --test with no coverage flags, so nothing breaks on those. fjs/ci/node/module.f.mjs:68 emits test({ run: 'npm run cov' }) as a plain step, so the thresholds take effect without regenerating; npm run ci-update produced zero drift.

The include pattern is untouched and no exclude was added, so nothing was narrowed to make 100% trivially true. npx tsc exit 0; fjs t → 2882 pass / 0 fail.

Two non-blocking notes: the body omits the Changelog: section CONTRIBUTING calls mandatory, and 1605.md skips the topic: prefix its siblings (15961602) use.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmWCv5YGRXToq26xPoSXjX
@sergey-shandar
sergey-shandar added this pull request to the merge queue Aug 16, 2026
Merged via the queue into main with commit 361ce1c Aug 16, 2026
19 checks passed
@sergey-shandar
sergey-shandar deleted the claude/cov-100-percent-gate branch August 16, 2026 03:42
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.

3 participants