Repository navigation
test: cover the e2e data-fixture webpack loader - #1130
Merged
Merged
Conversation
tests/tools/e2e-data-fixture-loader.cjs was imported by no test, so the coverage reporter had no row for it at all: it was unmeasured rather than under-measured, and --require-source-files guards only src/ and scripts/. Four cases drive the loader through a stand-in webpack context against the real committed overlays: the base overlay is applied via this.resourcePath, each applied overlay is registered with addDependency, E2E_COVERAGE_VARIANT layers both directories in order, and an unoverlaid data file is returned byte-for-byte. Each was mutation-checked against the behaviour it targets. 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 6, 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-data-fixture-loader.test.mjs, the first test to importtests/tools/e2e-data-fixture-loader.cjs— the webpack loaderdocusaurus.config.jsinstalls ondata/underE2E_COVERAGE=1, and thesingle point every overlay in
tests/e2e/fixtures/**passes through on its wayinto the end-to-end coverage build.
Before this,
grep -c e2e-data-fixture-loaderover thenpm run test:unit:coveragetable returned 0: the module had no row at all.tests/site-config.test.mjs:327asserts the config names the path, but neverloads it, and
--require-source-filesguardssrc/andscripts/rather thantests/tools/. Nothing in the repository could fall when the loader broke.Four cases, driving 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:
this.resourcePath.tests/e2e/fixtures/data/members.jsonappends one organization holding bothmembership roles, a status no real member carries; its arrival in the patched
document is proof the overlay for that path was found.
addDependency. Dropping thisbreaks nothing in a clean CI build and breaks incremental rebuilds locally,
leaving a stale overlay compiled in — the failure most easily misread as a
flaky spec.
E2E_COVERAGE_VARIANT=1layers both directories, in order.community-people.jsonis the one data file carrying an overlay in each, soit is the only path on which the ordering is observable; the variant's empty
fetchedAtwinning proves the base overlay did not overwrite it.round-trips through
JSON.parse/JSON.stringify, so a loader that forwardedunoverlaid files through it would silently reformat every other data document
in the build. The file is selected from the data directory at run time, since
which files carry an overlay changes as fixtures are added.
Each case was mutation-checked against the behaviour it targets — pinning
resourcePathto a fixed path, deleting theaddDependencyloop, returningsourceinstead ofpatched, and round-tripping unconditionally each turn therelevant tests red.
tests/tools/e2e-data-fixture-loader.cjsnow appears in the coverage table at100.00 | 100.00, and the new test file is itself at 100%.npm run test:unit:coverage:checkandnpm run checkboth exit 0. The diff isthe one new test file — no source, fixture, or workflow is touched.
Coordination
This does not edit
tests/tools/e2e-data-fixtures.cjsortests/e2e-data-fixtures.test.mjs, both occupied by #1110 (overlaySource'sroot-level-array
setWhere). That PR covers the overlay engine; this onecovers the loader wrapper around it.
Related Issue
Closes #1129
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88