Skip to content

test: cover DirectoryFreshness's plain-text source fallbacks end-to-end - #1330

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/e2e-directory-freshness-unlinked-sources
Oct 12, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/e2e-directory-freshness-unlinked-sources

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

DirectoryFreshness names each provenance source as plain text when that source carries no URL:

// src/components/MemberDirectory/DirectoryFreshness.js
25    {landscape?.sourceUrl ? (<a ...>cncf/landscape</a>) : ('cncf/landscape')}   // line 30
39    {architectures?.repository ? (<a ...>cncf/architecture</a>) : ('cncf/architecture')}  // line 44

Both arms are ordinary shapes — scripts/generate-members.mjs and npm run collect:metrics can pin a source they cannot address by URL — but the committed data always carries both URLs, so neither had ever run in a browser. tests/e2e/member-directory-freshness.spec.js asserts the other side and its comment already names this fallback.

Evidence. The e2e-coverage artifact (11718925360) of CI run 38182984387 — head fb75c1a — reported:

src/components/MemberDirectory/DirectoryFreshness.js | 100.00 | 69.23 |  | 19 30 44 49

Regions 19 and 49 are held by tests/e2e/fixtures/data-variant/members.json; 30 and 44 were held by no build.

What this adds

  • tests/e2e/fixtures/data-no-revision/metrics.json — also clears sources.architectures.repository
  • tests/e2e/fixtures/data-no-revision/members.json — new overlay clearing sources.landscape.sourceUrl
  • tests/e2e/member-directory-freshness-unlinked.spec.js — the real route renders both anchors; the no-revision route still renders both sentences, names both sources as text, and exposes no link in the note. A second case asserts the member grid is intact, so the first is evidence the ternary switched rather than that the page broke.
  • registrations the repository requires for both: the validator delta in tests/e2e-data-fixture-validity.test.mjs and the gated spec in tests/e2e-coverage-describe-gate.test.mjs

Why data-no-revision and not a new build

Each fixture directory is a full Docusaurus compile, and the "End-to-end coverage" job grows linearly in their number (tests/tools/e2e-data-fixtures.cjs). No new build is warranted here:

  • the ordinary coverage build is where the anchors at lines 26/40 are measured from — clearing the URLs there trades arms instead of adding a case;
  • the variant build makes collectedAt unparseable and clears generatedAt, so neither sentence renders and the ternaries are never evaluated;
  • the no-revision build leaves both timestamps alone, and ReferenceArchitectures returns at its revision guard (line 13) before reading sources.architectures.repository, so clearing the two URLs un-covers nothing that build reaches.

CI cost of this PR: zero additional compiles.

Verification (local, this branch)

  • npm run test:unit:coverage:check — 2420 tests, 0 failures; src files 100.00 / 100.00, gate exits 0
  • npm run build:e2e:coverage then the full Playwright coverage run — 346 passed, including reference-architectures-no-revision.spec.js, which proves the extra overlay does not disturb the build it rides on
  • rendered report over that run: DirectoryFreshness.js | 100.00 | 91.67 | | 19 — regions 69.23% → 91.67%, and src files regions 97.27% → 97.73% (641/659 → 646/661). Only region 19 remains, which belongs to the variant build's attribution problem, not to this change.
  • npx prettier --check . clean

Related Issue

Closes #1328


Human review required.

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

DirectoryFreshness names each provenance source as plain text when that
source carries no URL (lines 30 and 44), and neither arm had ever run in
a browser: the committed data always carries both URLs, and the e2e
coverage artifact of run 38182984387 reported the file at 69.23% regions
with 19, 30, 44 and 49 uncovered.

Both arms need their sentence to render while the URL is absent, which
conflicts with the ordinary coverage build (where the anchors at lines 26
and 40 are measured from) and with the variant build (which drops both
sentences). tests/e2e/fixtures/data-no-revision/ already holds that shape
and ReferenceArchitectures returns at its revision guard before reading
sources.architectures.repository, so the two URLs are cleared there rather
than in a new build directory, which would add a full Docusaurus compile
to the End-to-end coverage job.

Closes #1328

Signed-off-by: quality <quality@hive.kubestellar.io>
@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] DirectoryFreshness plain-text source fallbacks (lines 30, 44) are never exercised end-to-end

1 participant