Skip to content

test: cover CaseStudies' two empty-corpus arms with a variant build - #1133

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-case-studies-empty-corpus
Oct 7, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-case-studies-empty-corpus

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

src/components/CaseStudies/index.js branches on two document-level fields of
data/case-studies.json that the shipped corpus never produces, so neither arm
runs in a browser:

46   if (!data.generatedAt) return null;          // SyncStatus renders no provenance line
64   const caseStudies = data.caseStudies || [];  // the list the page sorts/filters/counts/maps

The e2e report on main names both: src/components/CaseStudies/index.js | 100.00 | 96.55 | | 46 64 (artifact e2e-coverage id 11383321728, job
End-to-end coverage, main at 7ab301e). The unit suite has them — this is
a browser-coverage gap, not an untested path.

tests/e2e/fixtures/data-variants/case-studies.json (new) — clears
generatedAt and caseStudies. It goes in the variant directory rather
than beside the existing additive overlay at
tests/e2e/fixtures/data/case-studies.json: both fields are document-level on
the one file the one /resources/case-studies page reads, so clearing them in
the ordinary coverage build would swap which arm is covered, trading the
provenance line and all 215 rows — including the two undated studies that
additive overlay exists to render — for these two. The variant site is served
beside the real one, so one Playwright run reaches both and neither displaces
the other. Same shape, and same remedy, as RadarReports in #1098.

tests/e2e/case-studies-variant.spec.js (new) — two cases. The real route
is asserted alongside the variant one on purpose: on its own, "the variant page
has no provenance line and no rows" passes just as well when the page failed to
build, so the pair is what makes it evidence the arms switched. Counts are
read from the corpus through loadSiteData rather than hard-coded, so an edited
overlay fails here instead of leaving a test that asserts nothing.

Verification

  • npm run test:unit — 1966 passed, 0 failed at 7ab301e + this diff.
    That includes tests/e2e-data-fixtures.test.mjs's "every committed overlay
    still applies to its data file", which picks the new overlay up with no edit
    to its hardcoded cases lists.

  • npm run build:e2e:coverage — succeeds, and the two builds render opposite
    arms:

    build/resources/case-studies/ build/e2e-coverage-variant/resources/case-studies/
    Mirrored from provenance line 1 0
    <th scope=row> rows 215 0
    results bar Showing 215 of 215 Showing 0 of 0
    No case studies match those filters. absent present
    <option> in the three selects 154 3 (one All … each)
    <th scope=col> 6 6

    Every locator the spec uses was checked against that markup.

  • loadSiteData('case-studies.json', …) returns generatedAt: 2026-09-24…
    with 215 studies for the coverage build and generatedAt: null,
    caseStudies: null for the variant build.

  • npx prettier --check on both new files — clean.

  • The Playwright spec itself could not be executed here: the sandbox has no
    root, so npx playwright install-deps chromium cannot run and
    chrome-headless-shell aborts with
    error while loading shared libraries: libglib-2.0.so.0. CI's
    End-to-end coverage job is the first real execution — the same limitation
    test: let data overlays patch a root-level JSON array with setWhere #1110 records.

What this does not do

It does not move lines 46 and 64 off the uncovered-region list.
getRegionCoverage in tests/tools/e2e-coverage-report.mjs keys a region on
its exact original line:column:endLine:endColumn, and the two builds'
generated code maps back to different coordinates, so the union keeps the real
build's zeros. That was measured on this identical shape in #1097 and is
tracked as #1066 / #1079; once the union folds the coordinates, these arms fold
with no change here. The spec is therefore stated as behaviour rather than as a
coverage claim, and the region gate (--check-source-regions 80) is unaffected.

Coordination

Touches only the two new files above. It does not edit
tests/e2e-data-fixtures.test.mjs (#1110, #1113),
tests/e2e/data-fixtures.spec.js / tests/tools/e2e-data-fixtures.cjs /
tests/e2e/fixtures/data/architectures/catalog.json (#1110),
tests/e2e/fixtures/data-variants/metrics.json (#1117),
tests/e2e/fixtures/data-variants/community-groups.json (#1113),
tests/e2e/fixtures/data-variants/members.json (#1104),
tests/e2e-coverage-report.test.mjs (#1114),
tests/e2e-coverage-scripts.test.mjs (#1128), or any workflow file.
src/components/CaseStudies/index.js is claimed by no open PR.

Related Issue

Closes #1132


Filed by quality agent (hold-gated mode). Human review required.

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

src/components/CaseStudies/index.js branches on two document-level fields of
data/case-studies.json that the shipped corpus never produces: SyncStatus's
`if (!data.generatedAt) return null` at line 46, and the `|| []` fallback at
line 64 that supplies the list the page sorts, filters, counts and maps.

Both are document-level on the one file the one /resources/case-studies page
reads, so clearing them in the ordinary coverage build would swap which arm is
covered rather than add a case -- it would trade the provenance line and all
215 rows, including the two undated studies the additive overlay in
tests/e2e/fixtures/data/case-studies.json exists to render. They go in the
variant build instead, as RadarReports' equivalent arms did in #1098.

Closes #1132

Signed-off-by: quality <quality@hive.kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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.

@hivecommons-hive hivecommons-hive Bot added quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI labels Oct 6, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 47c1e9c Oct 7, 2026
7 checks passed
mrbobbytables added a commit that referenced this pull request Oct 7, 2026
case-studies.json gained a variant overlay in #1133, and members.json
gains one in #1104; the architectures catalog is the remaining data file
the ordinary coverage build overlays and the variant build does not.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@mrbobbytables
mrbobbytables deleted the quality/test-case-studies-empty-corpus branch October 7, 2026 15:18
mrbobbytables added a commit to mrbobbytables/endusers that referenced this pull request Oct 8, 2026
…cncf#1113)

* test: cover GroupLinkStatus's plural arms and invalid-checkedAt guard

src/components/GroupLinkStatus/index.js is the lowest-covered file in the
end-to-end report at 60% of regions. Three of its four uncovered regions
are reachable, and all three need a second build:

  * line 7, formatDate's Number.isNaN guard, needs a checkedAt that does
    not parse, which the real file never carries;
  * lines 32-33, the plural arms of the drift warning, need two groups
    drifting at once, while the ordinary coverage overlay appends exactly
    one archived group.

Clearing checkedAt or emptying the list in the ordinary coverage build
would swap which arm renders rather than add a case, so the overlay goes
in tests/e2e/fixtures/data-variants/ and the variant site is asserted
beside the real one. The appended group drifts through reachable:false
rather than archived:true so the filter's second operand decides it, as a
link-check run that cannot reach a repository produces.

tests/e2e-data-fixtures.test.mjs used community-groups.json as the
contrast case for a file with no variant overlay, which this makes false.
case-studies.json takes that role: members.json is the other base-only
overlay, but open PR cncf#1104 adds a members.json variant, so it would stop
being a contrast as soon as that lands.

Verified by building both sites locally with npm run build:e2e:coverage
and reading the rendered HTML. build/community: verification line dated
"September 23, 2026", singular "has an archived or unreachable upstream
repository", one group named, no plural. build/e2e-coverage-variant/
community: no verification line and no "Invalid Date", plural "have
archived or unreachable upstream repositories", both groups named. The
Playwright run itself was not executed here -- this sandbox has no
browser (chrome-headless-shell cannot load libglib-2.0.so.0 and there is
no root to install it), so CI is the first place the spec runs.

Line 23's `|| []` is deliberately left uncovered: reaching it means
clearing `groups` entirely, which stops the warning rendering at all.

Signed-off-by: quality <quality@hive.kubestellar.io>

* test: move the no-variant contrast case to architectures/catalog.json

case-studies.json gained a variant overlay in cncf#1133, and members.json
gains one in cncf#1104; the architectures catalog is the remaining data file
the ordinary coverage build overlays and the variant build does not.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>

---------

Signed-off-by: quality <quality@hive.kubestellar.io>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: quality <quality@hive.kubestellar.io>
Co-authored-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] CaseStudies' two empty-corpus arms (lines 46, 64) have no end-to-end coverage

1 participant