Repository navigation
test: cover the e2e reporter's source-reference resolution branches - #1072
Merged
Merged
Conversation
Five reachable branches in the path that decides which source files e2e
coverage is attributed to had no unit coverage:
* repoRelative's empty-relative arm, the only thing that rejects a
reference resolving to the repository root (isInside accepts it)
* the empty-path arm for a webpack:// reference with no path after the
authority
* the three sourcesContent fallbacks, unexercised because every existing
fixture supplies sourcesContent even though the source-map spec makes
it optional
Regions in tests/tools/e2e-coverage-report.mjs rise 90.68% -> 92.23%, with
lines 98, 109, 199, 202 and 234 leaving the uncovered list and nothing else
changing. Test-only; no tooling change.
Closes #1071
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 automatically remove the |
This was referenced Oct 5, 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
Covers five reachable branches in the reference-resolution path of
tests/tools/e2e-coverage-report.mjs— the containment gate that decides whichsource files e2e coverage is attributed to. Test-only; no tooling change.
rel === ''inrepoRelativesourcePathFromReference rejects a reference that resolves to the repository rootslash === -1 ? ''insourcePathFromReferencesourcePathFromReference rejects a webpack reference with no path after the authoritysourcesContentfallbacks innormalizeSourceMapcollectE2ECoverage reads original content from disk when the map omits sourcesContentWhy these were worth pinning
isInsideexplicitly accepts the root directory itself (rel === ''at line 93). The only thing that then rejects the repository root as a
source file is
repoRelativereturningnullfor an empty relative path.That arm had nothing holding it.
webpack://<authority>with no following slash must yield an emptypath. Had it regressed to returning the unsliced value, the reference would
have resolved against the map's own directory inside
build/rather thanbeing rejected.
sourcesContentis optional in the source-map spec, butall 28 existing fixtures in this file supply it, so the entire
no-
sourcesContentpath was unexercised. The new fixture declares both asrc/source and anode_modules/source and omitssourcesContententirely, so one assertion covers reading the src source from disk and
blanking the external one.
Measured effect
npm run test:unit:coverageat900592b, node v26.10.0,TZ=UTC:e2e-coverage-report.mjs98 109 188 199 202 234 255-256 301 303 318-319 322 325-327 329 331 405 408 410 424 485 495 497 509 520 549 565 708 751188 255-256 301 303 318-319 322 325-327 329 331 405 408 410 424 485 495 497 509 520 549 565 708 751Exactly the five targeted regions left the list; nothing else moved. Repository
total
94.87% → 94.94%against the--check-regions 94floor.Line 188 (
map.resolvedSources ?? flattened.sources ?? []) is deliberately leftalone —
AnyMapalways populatesresolvedSources, so it appears unreachableand is not claimed here.
Verification
node --test tests/e2e-coverage-report.test.mjs— 38 passed, 0 failed.npm run test:unit:coverage:check— exit 0.npx prettier --check tests/e2e-coverage-report.test.mjs— exit 0.Scope note
This is a unit branch-coverage improvement in test tooling. It makes no
claim about any source path's end-to-end coverage: Playwright could not be
launched in this environment (
chrome-headless-shellfails on a missinglibglib-2.0.so.0; installing it needs root), and a publishede2e-coverageartifact cannot be rendered without the build that produced it — the subject of
the already-open #1040.
Coordination
Appends to
tests/e2e-coverage-report.test.mjsonly; no.mjstooling file istouched, so there is no logic overlap with any open PR.
convertScriptand the script-root resolution insidecollectE2ECoverage.getRegionCoverageand the region union.main()'s catch.None of them touch
sourcePathFromReference,repoRelativeornormalizeSourceMap. All of them also append to this test file, so the onlypossible interaction is an append-order rebase.
Related Issue
Closes #1071
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88