Repository navigation
test: cover MetricsDashboard's four empty-collection fallbacks end to end - #1117
Merged
Merged
Conversation
… end The component maps over four document-level collections of data/metrics.json through a fallback that supplies an empty one -- lifecycle cards (line 65), lifecycle omitted indicators (line 85), series (line 124) and breakdowns (line 174). The checked-in document always carries all four, so no fallback is reachable in the browser, and the e2e report lists every one as uncovered. Emptying the collections in the ordinary coverage build would trade every rendered card, disclosure item, line chart and bar chart for the fallback rather than add a case, so they go to the variant build: the existing metrics.json variant overlay now clears all four, and a new spec pairs /metrics with /e2e-coverage-variant/metrics so the arms are asserted to switch rather than one page happening to look a certain way. referenceArchitectureLifecycle.trends (line 76) is deliberately left alone: the same overlay appends to trends.submissions.values, and applyOverlay runs set before append, so clearing it would fail the build. Closes #1116 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
Closed
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
src/components/MetricsDashboard/index.jsmaps over four document-levelcollections of
data/metrics.jsonthrough a fallback that supplies an emptyone, and the e2e report lists all four as uncovered:
(lifecycle?.cards || []).map(...)(lifecycle?.omitted || []).map(...)Object.entries(metricsData.series || {})Object.entries(metricsData.breakdowns || {})The checked-in document always carries four cards, three omitted indicators,
two series and two breakdowns, so none of the fallbacks is reachable in the
browser. They are ordinary shapes rather than defensive dead code:
data/metrics.jsonis regenerated bynpm run collect:metrics, and acollector run that cannot reach one of its sources emits the document without
that collection.
What this changes
tests/e2e/fixtures/data-variants/metrics.json— the existing variantoverlay additionally clears
referenceArchitectureLifecycle.cards,referenceArchitectureLifecycle.omitted,seriesandbreakdowns.tests/e2e/metrics-empty-collections-variant.spec.js(new) — pairs/metricswith/e2e-coverage-variant/metrics. The real route must renderevery collection; the variant route must render none of them while the
lifecycle section, its heading, both trend labels and the
Last updatedline still render. Pairing the two is what makes this evidence that the arms
switched rather than that one page happens to look a certain way.
Emptying the collections in the ordinary coverage build would trade every
rendered card, disclosure item, line chart and bar chart for the fallback
rather than add a case, which is why they belong to the variant build —
the same reason
AwardsTimeline's provenance paragraph does.Deliberately out of scope
referenceArchitectureLifecycle.trends(line 76) is left alone. The sameoverlay appends a point to
trends.submissions.valuesfortests/e2e/metrics-sparkline-variant.spec.js, andapplyOverlayintests/tools/e2e-data-fixtures.cjsappliessetbeforeappend, so clearingtrendswould make that append throw and fail the build. Reaching line 76needs a second variant build, not a second entry in this overlay. The fixture
and the spec both say so in place.
Verification
npm run build:e2e:coverageat7ab301ewith this change applied, then bothrendered documents read directly:
build/metrics/index.htmlbuild/e2e-coverage-variant/metrics/index.htmllifecycleCardelements<p>inside the lifecycle<details>sectionperseriesidsectionperbreakdownsidLast updatednpm run test:unit— 1966 passed, 0 failed (the overlay is validated bytests/e2e-data-fixtures.test.mjs, which loads every committed overlay).npx prettier --checkandnpx eslintclean on both files.The Playwright run itself could not be executed in this agent's
environment:
chrome-headless-shellfails to start witherror while loading shared libraries: libglib-2.0.so.0, and the sandbox hasno root to install it. Every assertion in the new spec is instead verified
above against the HTML the two builds actually emit; the browser run is left
to the
End-to-end coveragejob on this PR.Coordination
Touches only
tests/e2e/fixtures/data-variants/metrics.jsonand the newtests/e2e/metrics-empty-collections-variant.spec.js. It does not edittests/e2e-data-fixtures.test.mjs(#1113, #1110),tests/e2e/data-fixtures.spec.jsortests/tools/e2e-data-fixtures.cjs(#1110), or
tests/e2e-coverage-report.test.mjs(#1114). Thecaseslist intests/e2e-data-fixtures.test.mjsis hardcoded and not exhaustive, so a newsetentry needs no edit there. No workflow file is involved: the gate--check-source-regions 80only rises.This PR does not promise the four regions leave the report's uncovered list.
tests/tools/e2e-coverage-report.mjskeys a region on its exact originalcoordinates and the two builds' generated code does not always map back to the
same ones — that is the region-attribution problem tracked in #1066 and #1079.
Where it folds, these fold with no further change here.
Related Issue
Closes #1116
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88