Skip to content

test(engine): merge predicted-gate-engine-branch-coverage.test.ts into predicted-gate-engine.test.ts#8584

Merged
JSONbored merged 1 commit into
mainfrom
test/consolidate-predicted-gate-engine-coverage
Jul 24, 2026
Merged

test(engine): merge predicted-gate-engine-branch-coverage.test.ts into predicted-gate-engine.test.ts#8584
JSONbored merged 1 commit into
mainfrom
test/consolidate-predicted-gate-engine-coverage

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #8575.

Summary

predicted-gate-engine-coverage.test.ts (1432 lines) and predicted-gate-engine-branch-coverage.test.ts (708 lines) were two disconnected #2283 bolt-ons against the same gate-advisory/predicted-gate-engine module family — both cite #2283 in their top-level describe. Merged into one file (predicted-gate-engine.test.ts) as two describe blocks, keeping every case verbatim — a pure relocation, no case retitled or dropped.

Given the density of these files (each it() block often exercises many branch arms across dozens of assertions), I did not attempt to dedupe individual assertions inside the mega-tests — too high a risk of silently dropping real coverage for a large mechanical merge. The consolidation win here is file organization: one home for the module family instead of two disconnected bolt-ons.

One identifier collision: both files declared a top-level REPO const with different shapes (the larger file's is a hand-written literal object; the smaller file's is repo("acme/widgets") from its own factory helper). Renamed the smaller file's to BRANCH_REPO throughout — everything else (repo()/pr() factory functions, all other imports) had zero collisions.

Test plan

  • npx vitest run test/unit/predicted-gate-engine.test.ts — 33/33 pass
  • npm run typecheck — clean
  • Coverage regression check, before (both original files) vs after (merged): identical across every module the file exercises —
    • gate-advisory.ts: 219/225 branches (97.33%), 154/154 lines (100%)
    • predicted-gate-engine.ts: 332/339 branches (97.93%), 282/283 lines (99.64%)
    • cla-check.ts: 27/27 branches (100%), 13/13 lines (100%)
    • pre-merge-checks.ts: 33/34 branches (97.05%), 22/22 lines (100%)
    • change-guardrail.ts: 34/36 branches (94.44%), 45/45 lines (100%)
    • duplicate-winner.ts: 21/22 branches (95.45%), 19/19 lines (100%)

…o predicted-gate-engine.test.ts (#8575)

predicted-gate-engine-coverage.test.ts (1432 lines) and
predicted-gate-engine-branch-coverage.test.ts (708 lines) were two
disconnected #2283 bolt-ons against the same gate-advisory/
predicted-gate-engine module family. Merge into one file
(predicted-gate-engine.test.ts) as two describe blocks, keeping every
case verbatim -- a pure relocation, no case retitled or dropped.

Renamed the smaller file's local REPO const to BRANCH_REPO to resolve
the one identifier collision between the two files (its shape differs
from the larger file's REPO -- a shared literal object -- so they
cannot be merged into a single fixture without changing what several
tests exercise). No other identifiers collided.

Verified zero coverage regression across every module the merged file
exercises (gate-advisory.ts, predicted-gate-engine.ts, cla-check.ts,
pre-merge-checks.ts, change-guardrail.ts, duplicate-winner.ts) --
before/after branch and line coverage identical on all six.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 24, 2026
@JSONbored
JSONbored merged commit 95cfee7 into main Jul 24, 2026
4 checks passed
@JSONbored
JSONbored deleted the test/consolidate-predicted-gate-engine-coverage branch July 24, 2026 22:26
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.99%. Comparing base (346c183) to head (59d3a9c).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8584      +/-   ##
==========================================
- Coverage   92.54%   91.99%   -0.56%     
==========================================
  Files         796      796              
  Lines       79845    79845              
  Branches    24134    24134              
==========================================
- Hits        73896    73452     -444     
- Misses       4802     5309     +507     
+ Partials     1147     1084      -63     
Flag Coverage Δ
backend 92.95% <ø> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

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.

Merge predicted-gate-engine-branch-coverage.test.ts into predicted-gate-engine-coverage.test.ts

1 participant