Repository navigation
[quality] the e2e data-fixture webpack loader is imported by no test and has no coverage row at all #1129
Description
Finding
tests/tools/e2e-data-fixture-loader.cjs is the webpack loader
docusaurus.config.js installs on data/ when E2E_COVERAGE=1. Every data
overlay in tests/e2e/fixtures/data/** and
tests/e2e/fixtures/data-variants/** passes through it on the way into the
end-to-end coverage build — it is the single point of contact between the
overlay engine and the bundle the e2e region gate is measured against.
Nothing imports it, and the coverage reporter has no row for it at all.
$ grep -rl e2e-data-fixture-loader . --exclude-dir=node_modules --exclude-dir=.git
./docusaurus.config.js # names the path as a string (line 67)
./tests/tools/e2e-data-fixtures.cjs # prose reference in a comment
./tests/site-config.test.mjs # line 327 asserts that same string
tests/site-config.test.mjs:327 checks that the config mentions the loader;
it never loads the module. So the loader's own body — the three lines that read
this.resourcePath, register each overlay with addDependency, and return the
patched source — has never been executed outside a real webpack build.
This is the failure mode the reporter's own header warns about:
A file under
scripts/orsrc/that no test imports is recorded nowhere,
so it never becomes a row: its lines are absent from the numerator and the
denominator alike andsrc filesdoes not move.
—tests/tools/coverage-report.mjs
--require-source-files exists to catch exactly that, but it guards src/ and
scripts/. The loader lives under tests/tools/, so no threshold in the
repository can fall when it breaks.
Why it matters here specifically
Each of the loader's three behaviours fails quietly:
- Overlaying something other than
this.resourcePath. No overlay matches,
every data file passes through unchanged, the build succeeds, and the site
serves the checked-in corpus. The variant specs that exist to drive the
overlaid branches then assert against the wrong document — and several of
them (data-variants.spec.js,radar-reports-variant.spec.js,
metrics-sparkline-variant.spec.js) are written to tolerate the arm they
target not rendering. - Dropping
addDependency. Nothing breaks in a clean CI build. It breaks
incremental rebuilds locally: editing a fixture leaves the previous overlay
compiled in, which is the failure mode most likely to be misread as a flaky
spec. - Returning the round-tripped source for an unoverlaid file. The overlay
engine goes throughJSON.parse/JSON.stringify, so a loader that forwarded
every file through it would silently reformat all nine data documents in the
coverage build.
Evidence and provenance
- Unit — no coverage and no row.
npm run test:unit:coverage(TZ=UTC node tests/tools/coverage-report.mjs,
node v26.10.0) run locally on 2026-10-06 atmain=7ab301e:
grep -c e2e-data-fixture-loaderover the output returns 0. The module
is absent from the table entirely, which is a stronger statement than a low
percentage — it is unmeasured, not under-measured. - End-to-end — no surface, and no claim made. The e2e reporter instruments
only the browser-servedsrc/**bundle (CI artifacte2e-coverage, id
11428330480, run
37496141453, job
End-to-end coverage—src/**rows only). A build-time webpack loader is
never loaded by a browser, so the unit/e2e priority table does not apply and
no missing-e2e claim is made. The limitation is recorded here rather than
inferred from the unit profile. - Priority 2: three lines, but they are the lines that decide whether every
overlay-driven e2e spec in the repository is testing what it says it is.
Recommendation
- Add
tests/e2e-data-fixture-loader.test.mjsinvoking the loader with a
stand-in webpack context (resourcePath+addDependency) against the
real committed overlays, covering:
- the base overlay fordata/members.jsonis found and applied via
this.resourcePath
- the overlay path is registered withaddDependency
-E2E_COVERAGE_VARIANT=1layersfixtures/datathen
fixtures/data-variantsand registers both, in order
- a data file with no committed overlay comes back byte-for-byte and
registers nothing -
tests/tools/e2e-data-fixture-loader.cjsappears in the
npm run test:unit:coveragetable at 100% regions
The cases should drive the real committed overlays rather than fixtures of
their own: the loader's contract is with those files, and a test supplying its
own would not notice the wiring changing underneath it. Each case should be
written so that breaking the single behaviour it targets fails it.
Coordination
The change is one new file, tests/e2e-data-fixture-loader.test.mjs. It does
not edit tests/tools/e2e-data-fixtures.cjs or
tests/e2e-data-fixtures.test.mjs — both occupied by #1110, which covers
overlaySource's root-level-array setWhere behaviour. This issue is about
the loader wrapper around that engine, not the engine. No fixture, source file,
or workflow is involved; the existing npm run test:unit:coverage:check gate
already covers the new row.
Priority
- Impact: medium (an unmeasured module that silently decides whether the
overlay-driven e2e specs assert against the overlaid corpus at all) - Effort: low
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: fcc2529
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88
Activity