test(engine): merge predicted-gate-engine-branch-coverage.test.ts into predicted-gate-engine.test.ts#8584
Merged
Conversation
…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.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Closes #8575.
Summary
predicted-gate-engine-coverage.test.ts(1432 lines) andpredicted-gate-engine-branch-coverage.test.ts(708 lines) were two disconnected #2283 bolt-ons against the samegate-advisory/predicted-gate-enginemodule 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
REPOconst with different shapes (the larger file's is a hand-written literal object; the smaller file's isrepo("acme/widgets")from its own factory helper). Renamed the smaller file's toBRANCH_REPOthroughout — 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 passnpm run typecheck— cleangate-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%)