Skip to content

test: cover RadarReports' empty-corpus arms in the e2e variant build - #1098

Merged
castrojo merged 1 commit into
mainfrom
quality/test-radar-reports-empty-corpus-e2e
Oct 6, 2026
Merged

castrojo merged 1 commit into
mainfrom
quality/test-radar-reports-empty-corpus-e2e

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

src/components/RadarReports/index.js branches on two document-level fields of
data/radar-reports.json:

  • line 6 — if (!data.generatedAt) return null;, so SyncStatus renders no
    provenance line;
  • line 24 — const radarReports = data.radarReports || [];, the fallback that
    supplies the list the page maps over.

Neither is reachable against the checked-in corpus, which always carries a
generatedAt and six reports. Both are ordinary shapes: the file is
regenerated daily from cncf.io by npm run collect:radar-reports via
.github/workflows/refresh-radar-reports.yml, so a collector run that fetches
nothing produces exactly them.

Two new files, no edits to existing ones:

  • tests/e2e/fixtures/data-variants/radar-reports.json — clears both fields in
    the variant build. Clearing them in the ordinary coverage build would trade
    the provenance line and all six rendered reports for these arms rather than
    add a case, which is the same reason AwardsTimeline's provenance paragraph
    lives in the variant build.
  • tests/e2e/radar-reports-variant.spec.js — pairs /resources/radar-reports
    with /e2e-coverage-variant/resources/radar-reports, asserting the
    provenance line and all six <li> on the first and neither on the second.
    Asserting the real route too is what makes the pair evidence that the arms
    switched, rather than that one page happens to look a certain way.

What this does not do

It does not move lines 6 and 24 out of the e2e report's uncovered list, and
the PR does not claim to. The browser demonstrably takes both arms — the
variant chunk keeps the branches (function i(){if(!o.ro)return null;...} and
let e=o.Gb||[], compiled against {"ro":null,...,"Gb":null}) and the
assertions only pass if it did — but getRegionCoverage in
tests/tools/e2e-coverage-report.mjs keys a region on its exact original
coordinates, and the two builds map back to different ones: the real build
records 6:25:6:37 count 0 and 24:40:24:46 count 0, while the variant
records 7:2:21:1 count 0 and 21:0:29:26 count 1 and emits no key matching
either zero region. That residue is #1066 / #1079; once the union folds the two
builds' coordinates, these arms fold with no change here. The spec preamble
records the observed keys so the next reader does not have to re-derive them.

Verification

Run locally at 8afaa67:

  • npm run test — 1941 passed, 0 failed.
  • npm run build:e2e:coverage then npm run test:e2e:coverage with a
    Playwright chromium run — 300 passed, 0 failed, including both new cases.
  • npm run report:e2e:coverage -- --check-source 100 --check-source-regions 80 --require-source-files — exit 0; src files 87.79% regions, well above the
    CI floor of 80, so .github/workflows/ci.yml needs no change.

Files claimed

tests/e2e/fixtures/data-variants/radar-reports.json (new) and
tests/e2e/radar-reports-variant.spec.js (new). Disjoint from every open
hold-gated PR: it does not touch tests/e2e-data-fixtures.test.mjs (#1034,
#1078), tests/e2e/data-variants.spec.js (#1034),
tests/tools/e2e-coverage-report.mjs (#1040, #1070),
tests/e2e/fixtures/data-variants/metrics.json (#1093), or any member
directory, case studies, or svg-active-content file. The cases lists in
tests/e2e-data-fixtures.test.mjs are hardcoded rather than exhaustive, so a
new variant overlay needs no edit there — the same reason #1093's metrics.json
variant needed none.

Related Issue

Refs #1097 — the first completion box (the overlay and the spec) is what this
lands; the second (lines 6 and 24 leaving the uncovered-region list) stays open
and is gated on the region-union work in #1066 / #1079, which lives in
tests/tools/e2e-coverage-report.mjs and is occupied by #1040 and #1070.


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/RadarReports/index.js branches on two document-level fields of
data/radar-reports.json: SyncStatus returns null when generatedAt is absent
(line 6), and the list falls back to [] when radarReports is absent (line 24).
Neither arm is reachable against the checked-in corpus, which always carries a
generatedAt and six reports -- but both are ordinary shapes, since the file is
regenerated daily from cncf.io by the refresh-radar-reports workflow and a run
that fetches nothing produces exactly them.

Adds tests/e2e/fixtures/data-variants/radar-reports.json clearing both fields,
and a spec pairing /resources/radar-reports with its variant route so the pair
is evidence the arms switched rather than that one page happens to look a
certain way.

The browser takes both arms -- the variant chunk keeps the branches and the
assertions only pass if it did -- but the two regions do not yet leave the
e2e report's uncovered list: the region union keys on exact original
coordinates and the two builds map back to different ones (#1066,
#1079). The spec preamble records the observed keys.

Refs #1097

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive hivecommons-hive Bot added the hold label Oct 5, 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.

@castrojo
castrojo added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit d2dc077 Oct 6, 2026
7 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-radar-reports-empty-corpus-e2e branch October 7, 2026 15:18
mrbobbytables pushed a commit to mrbobbytables/endusers that referenced this pull request Oct 8, 2026
…ncf#1133)

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 cncf#1098.

Closes cncf#1132

Signed-off-by: quality <quality@hive.kubestellar.io>
Co-authored-by: quality <quality@hive.kubestellar.io>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant