Repository navigation
test: pin the e2e region fold's same-key max arm - #1142
Merged
Merged
Conversation
getRegionCoverage keys a region on its original coordinates and keeps the higher of two counts recorded against one key. normalizeRanges splits a line carrying an inner zero-count range into an uncovered half and a covered remainder, and both halves map back to the same original span, so that fold is what stops every measured file carrying a phantom zero region -- yet line 360 had no unit coverage. Adds a fixture whose inner zero-count range stops short of the end of its line, asserting the file reports two regions both covered rather than three with the line named, and that the same source measured by the real build and the variant build folds to the same two regions instead of four. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This was referenced Oct 7, 2026
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.
Test Improvement
Adds
tests/e2e-coverage-region-union.test.mjs, pinning the same-key max arm ofgetRegionCoverage(tests/tools/e2e-coverage-report.mjs:360):Two branch locations sharing one key is what the pipeline produces for every
file it measures, not a corner case.
normalizeRangesflattens a V8 record intonon-overlapping ranges, so an inner zero-count range in the middle of a line
splits that line into an uncovered range and a covered remainder; both halves
resolve to the same original span, because the generated columns they start at
carry no mapping of their own. Keyed by branch id they would be two regions, one
permanently zero; keyed by coordinates they are one region the covered half
carries.
Two cases:
two branch locations on one original span fold to a single covered region— a fixture whose inner zero-count range stops short of the end ofline 2, asserting the file reports 2 regions both covered rather than 3 with
line 2 named, in the per-file rows and in the summary the merge gate reads.
the same file measured by both builds folds rather than doubling— thereal build and the
/e2e-coverage-variant/build compile the same source, sothe second script contributes the same two keys; the report stays at 2 regions
rather than 4, with
scripts.convertedat 2 to show both were read.Both were mutation-checked against
main: replacing the guard withif (!existing)(first wins) turns both red, and addingbranchIdto the keyturns both red.
tests/tools/e2e-coverage-report.mjsmoves 92.89% → 93.15% region coverage andline 360 leaves the uncovered-region list.
npm run test:unit:coverage:check,npm run check:spellingandnpx prettier --checkare all green at7ab301e+ this commit (node v26.10.0,TZ=UTC).Scope and coordination
One new file. It does not edit
tests/e2e-coverage-report.test.mjs(occupied by #1114),
tests/e2e-coverage-scripts.test.mjs(#1128),tests/e2e-data-fixture-loader.test.mjs(#1130), ortests/tools/e2e-coverage-report.mjsitself. Distinct from #1066 / #1079, whichare about whether the two builds emit matching coordinates in a real run; this
covers the fold that runs once they do, reachable from a unit fixture with no
variant build.
Related Issue
Closes #1141
Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88