Skip to content

test: cover the e2e data-fixture webpack loader - #1130

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-data-fixture-loader
Oct 7, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-data-fixture-loader

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/e2e-data-fixture-loader.test.mjs, the first test to import
tests/tools/e2e-data-fixture-loader.cjs — the webpack loader
docusaurus.config.js installs on data/ under E2E_COVERAGE=1, and the
single point every overlay in tests/e2e/fixtures/** passes through on its way
into the end-to-end coverage build.

Before this, grep -c e2e-data-fixture-loader over the
npm run test:unit:coverage table returned 0: the module had no row at all.
tests/site-config.test.mjs:327 asserts the config names the path, but never
loads it, and --require-source-files guards src/ and scripts/ rather than
tests/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:

  • the overlay is keyed off this.resourcePath.
    tests/e2e/fixtures/data/members.json appends one organization holding both
    membership roles, a status no real member carries; its arrival in the patched
    document is proof the overlay for that path was found.
  • every applied overlay is registered with addDependency. Dropping this
    breaks 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=1 layers both directories, in order.
    community-people.json is the one data file carrying an overlay in each, so
    it is the only path on which the ordering is observable; the variant's empty
    fetchedAt winning proves the base overlay did not overwrite it.
  • an unoverlaid data file comes back byte-for-byte. The overlay engine
    round-trips through JSON.parse/JSON.stringify, so a loader that forwarded
    unoverlaid 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
resourcePath to a fixed path, deleting the addDependency loop, returning
source instead of patched, and round-tripping unconditionally each turn the
relevant tests red.

tests/tools/e2e-data-fixture-loader.cjs now appears in the coverage table at
100.00 | 100.00, and the new test file is itself at 100%.
npm run test:unit:coverage:check and npm run check both exit 0. The diff is
the one new test file — no source, fixture, or workflow is touched.

Coordination

This does not edit tests/tools/e2e-data-fixtures.cjs or
tests/e2e-data-fixtures.test.mjs, both occupied by #1110 (overlaySource's
root-level-array setWhere). That PR covers the overlay engine; this one
covers the loader wrapper around it.

Related Issue

Closes #1129

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

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>
@hivecommons-hive hivecommons-hive Bot added the hold label Oct 6, 2026
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the e2e data-fixture webpack loader is imported by no test and has no coverage row at all

1 participant