Repository navigation
test: hold every committed e2e data overlay to the directory, not a list - #1100
Merged
Merged
Conversation
The two guards over committed overlays in tests/e2e-data-fixtures.test.mjs carry hand-written file lists, and nothing in the repository reads tests/e2e/fixtures/data/ or tests/e2e/fixtures/data-variants/ to find out what is actually there. applyOverlay already rejects an overlay naming a path the real data no longer has, so that failure is loud. The one with no symptom is the opposite: an overlay that applies cleanly and changes nothing -- a set writing the value already present, an append of a record a collector has since started producing -- compiles a document identical to the real data and silently stops reaching the branch it exists for. Adds a directory-derived guard in a new file: every committed overlay names a data file that exists, still applies to it, still changes it, and still names the source whose arm it covers. Replacing data-variants/awards.json with a no-op that sets verifiedAt to its current value leaves npm run test:unit green before this and fails it after. Closes #1099 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 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
Nothing in the repository reads
tests/e2e/fixtures/data/ortests/e2e/fixtures/data-variants/to find out what is committed there. Thetwo guards over committed overlays in
tests/e2e-data-fixtures.test.mjscarryhand-written file lists (lines 180-196 and 218-248), and
grep -n readdir tests/e2e-data-fixtures.test.mjsreturns nothing.applyOverlayis already strict about paths, so an overlay naming a field aregenerated data file no longer has throws and
npm run build:e2e:coveragefails loudly. The failure mode with no symptom is the opposite one — an
overlay that applies cleanly and changes nothing:
setwriting the value the data already carries;appendof a record a collector has since started producing itself.The build succeeds, the coverage build compiles a document identical to the
real data, and the branch the overlay exists to reach silently stops being
reached. From CI that is indistinguishable from a branch that was never
covered.
This adds
tests/e2e-data-fixture-integrity.test.mjs, which derives its casesfrom the directory contents and holds every committed overlay to the weaker
property the directory alone can establish:
cannot pass vacuously);
data/<name>.jsonthat exists;message names the overlay instead of arriving from inside a webpack loader;
descriptionnames the source file whose arm it covers, soa stale overlay is traceable to the component that stopped needing it.
It deliberately does not duplicate the existing guards: those pin
applyOverlay's behaviour against overlay documents built inline, which adirectory sweep does not and should not do.
Verification
Run locally at
8afaa67:npm run check— exit 0.npm run test:unit— 1946 passed, 0 failed (1941 before, plus the fivecases here).
npm run test:unit:coverage— the new file reports 100.00% lines and100.00% regions;
src filesunchanged at 100.00% / 99.92%.tests/e2e/fixtures/data-variants/awards.jsonwith a no-op that setsverifiedAtto the valuedata/awards.jsonalready carries leaves the fourother cases green and fails exactly one:
tests/e2e/fixtures/data-variants/awards.json: applies cleanly but patches nothing, so the branch it exists to reach is no longer reached. The sameno-op leaves
npm run test:unitgreen without this file. The probe wasreverted; it is not part of the diff.
Files claimed
tests/e2e-data-fixture-integrity.test.mjs(new). Nothing else is touched.Disjoint from every open hold-gated PR — in particular it does not edit
tests/e2e-data-fixtures.test.mjs(#1034 lines 178-215, #1078 lines 78-91),tests/e2e/data-variants.spec.js(#1034), ortests/tools/e2e-coverage-report.mjs(#1040, #1070). It adds no fixture, so itdoes not collide with #1093's
data-variants/metrics.json, #1065'sfixtures/data/case-studies.json, #1054'sfixtures/data/community-people.json,or #1098's
data-variants/radar-reports.json.Related Issue
Closes #1099
Folding the two hand-written per-branch lists into the directory sweep does
require editing the occupied
tests/e2e-data-fixtures.test.mjs; that isrecorded in #1099's Coordination section as out of scope and left for once
#1034 and #1078 land. It is not part of what #1099 tracks, so merging this
leaves nothing open on it.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88