You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[quality] e2e reporter's source-reference resolution has five untested branches (repoRelative root, bare webpack authority, absent sourcesContent) #1071
Five reachable branches in the reference-resolution path of tests/tools/e2e-coverage-report.mjs have no unit coverage. That path is the
containment gate that decides which source files e2e coverage is attributed to,
so its untested arms are the ones that would silently mis-attribute or silently
drop coverage.
At 900592b the file reports 100.00% lines / 90.68% regions, with these
among the uncovered regions:
line
branch
what is untested
98
rel === '' || rel.startsWith('..') in repoRelative
a reference resolving to the repository root itself
109
slash === -1 ? '' : value.slice(slash) in sourcePathFromReference
webpack://<authority> with no path after the authority
199
map.sourcesContent?.[index] ?? null in normalizeSourceMap
a map carrying no sourcesContent array at all
202
sourcesContent.push(suppliedContent ?? '')
blanking an external source when no content was supplied
reading a src source from disk when no content was supplied
Why these matter
98 — isInside(root, candidate) returns true for the root directory
itself (rel === '' is explicitly accepted at line 93). The only thing that
then rejects the root is repoRelative returning null for an empty
relative path. Nothing exercises that arm, so the guard that stops the
repository root being treated as a source file is unpinned.
109 — a webpack:// reference with no slash after the authority yields an
empty path. If that arm regressed to returning the unsliced value, the
reference would resolve against the map's own directory inside build/
instead of being rejected.
199 / 202 / 234 — sourcesContent is optional in the source-map spec.
Every existing fixture in tests/e2e-coverage-report.test.mjs supplies it
(28 call sites, all with a sourcesContent array), so the entire
no-sourcesContent path — read the src source from disk, blank the external
one — is unexercised. A toolchain change that stopped emitting sourcesContent would exercise it for the first time in CI.
Note that line 188 (map.resolvedSources ?? flattened.sources ?? []) is also
reported uncovered but appears unreachable, since AnyMap always populates resolvedSources. It is deliberately excluded from this issue.
This is a unit branch-coverage gap in test tooling. No claim is made here
about any source path's end-to-end coverage: Playwright could not be launched
in this environment (chrome-headless-shell fails on a missing libglib-2.0.so.0, and installing it needs root), and the published e2e-coverage artifact cannot be rendered without the build that produced
it — which is the subject of the already-open test: make the e2e coverage artifact renderable without its build #1040.
Recommendation
Add three cases to tests/e2e-coverage-report.test.mjs:
A collectE2ECoverage fixture whose map declares both a src/ source
and a node_modules/ source and omits sourcesContent entirely, asserting
the src source is still attributed with the right per-line counts
(lines 199, 202, 234).
Measured effect of exactly these three: regions 90.68% → 92.23%, with 98 109 199 202 234 leaving the uncovered list and nothing else changing. Repository
region total 94.87% → 94.94%, against the --check-regions 94 floor.
No production change is needed; this is test-only.
Coordination
Appends to tests/e2e-coverage-report.test.mjs and changes no .mjs tooling.
Finding
Five reachable branches in the reference-resolution path of
tests/tools/e2e-coverage-report.mjshave no unit coverage. That path is thecontainment gate that decides which source files e2e coverage is attributed to,
so its untested arms are the ones that would silently mis-attribute or silently
drop coverage.
At
900592bthe file reports 100.00% lines / 90.68% regions, with theseamong the uncovered regions:
rel === '' || rel.startsWith('..')inrepoRelativeslash === -1 ? '' : value.slice(slash)insourcePathFromReferencewebpack://<authority>with no path after the authoritymap.sourcesContent?.[index] ?? nullinnormalizeSourceMapsourcesContentarray at allsourcesContent.push(suppliedContent ?? '')sourcesContent.push(suppliedContent ?? diskContent)Why these matter
isInside(root, candidate)returnstruefor the root directoryitself (
rel === ''is explicitly accepted at line 93). The only thing thatthen rejects the root is
repoRelativereturningnullfor an emptyrelative path. Nothing exercises that arm, so the guard that stops the
repository root being treated as a source file is unpinned.
webpack://reference with no slash after the authority yields anempty path. If that arm regressed to returning the unsliced value, the
reference would resolve against the map's own directory inside
build/instead of being rejected.
sourcesContentis optional in the source-map spec.Every existing fixture in
tests/e2e-coverage-report.test.mjssupplies it(28 call sites, all with a
sourcesContentarray), so the entireno-
sourcesContentpath — read the src source from disk, blank the externalone — is unexercised. A toolchain change that stopped emitting
sourcesContentwould exercise it for the first time in CI.Note that line 188 (
map.resolvedSources ?? flattened.sources ?? []) is alsoreported uncovered but appears unreachable, since
AnyMapalways populatesresolvedSources. It is deliberately excluded from this issue.Evidence and provenance
npm run test:unit:coverage(TZ=UTC node tests/tools/coverage-report.mjs,node v26.10.0), run locally at revision
900592b—tests/tools/e2e-coverage-report.mjs100.00% lines / 90.68% regions,uncovered regions
98 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 751.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, and installing it needs root), and the publishede2e-coverageartifact cannot be rendered without the build that producedit — which is the subject of the already-open test: make the e2e coverage artifact renderable without its build #1040.
Recommendation
Add three cases to
tests/e2e-coverage-report.test.mjs:sourcePathFromReference('webpack://endusers', ...)→null(line 109).sourcePathFromReference('../../..', '<root>/build/assets/js/app.js.map', '<root>')→
null(line 98).collectE2ECoveragefixture whose map declares both asrc/sourceand a
node_modules/source and omitssourcesContententirely, assertingthe src source is still attributed with the right per-line counts
(lines 199, 202, 234).
Measured effect of exactly these three: regions
90.68% → 92.23%, with98 109 199 202 234leaving the uncovered list and nothing else changing. Repositoryregion total
94.87% → 94.94%, against the--check-regions 94floor.No production change is needed; this is test-only.
Coordination
Appends to
tests/e2e-coverage-report.test.mjsand changes no.mjstooling.convertScriptand the script-root resolution incollectE2ECoverage; it does not touchsourcePathFromReference,repoRelativeornormalizeSourceMap.getRegionCoverageand the region union.main()'s catch.All three also append to this test file, so the only possible interaction is an
append-order rebase, not a logic conflict.
Completion criteria
webpack://reference with no path after the authority is pinned as rejectedsourcesContentis pinned to read src content from disk and blank external sourcestests/tools/e2e-coverage-report.mjsregion coverage rises and lines 98, 109, 199, 202 and 234 leave the uncovered listPriority
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5n31| SHA:900592b— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88