Skip to content

test: assert siteUrlToFile rejections and unquoted attribute values; clear two coverage-floor entries - #294

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-clear-floor-availability-markup
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-clear-floor-availability-markup

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Follows #292's pattern for the per-file branch-coverage ratchet (TEST_HELPER_BASELINE, #288/#291): assert the reachable dead ranges, remove the provably unreachable one, delete the entries at zero.

scripts/availability-probes.test.mjs (2 → 0): siteUrlToFile's two return null arms (bare origin, foreign host) were shielded by probeListProblems, which rejects both URLs before the resolver runs — so the resolver's own contract was never pinned. A direct fixture now asserts it, including the deliberate difference from page-meta's resolver (bare origin ≠ home page here, because an unslashed probe URL gets a 301 from Pages).

scripts/page-markup.test.mjs (2 → 0): attrValue's unquoted-value arm never executed — every fixture used double quotes — so a regression in reading for=name / id=name / lang=en would have shipped silently. A fixture now runs the idref, duplicate-id and html-lang rules over unquoted and single-quoted attributes. The trailing ?? "" is unreachable (exactly one alternation matches; the quoted ones capture ""), so it is removed rather than left behind an allowance.

Both are in one PR because they edit the same TEST_HELPER_BASELINE lines; splitting them would only force a rebase.

Verification: node --test scripts/*.test.mjs → 794 pass / 0 fail. Before the baseline edit, coverage-floor.test.mjs fails with "0 dead ranges left, baseline allows 2 — lower TEST_HELPER_BASELINE" for both files, so the test fails without the fix.


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…; clear two coverage-floor entries

availability-probes: siteUrlToFile's two null arms — the bare origin and a
foreign host — were only reachable through probeListProblems, which rejects
both before calling it, so nothing pinned what the resolver itself decides.
A direct fixture now does, including the deliberate difference from
page-meta's resolver: here the bare origin is not the home page, because a
probe URL without its trailing slash gets a 301 from GitHub Pages.

page-markup: attrValue's unquoted-value arm never ran — every fixture used
double quotes — so a regression there would have shipped silently. A fixture
now runs the idref, duplicate-id and html-lang rules over unquoted and
single-quoted attributes. The trailing `?? ""` could never run: exactly one
of the three alternations matches, and the quoted ones capture "" for an
empty value. It is removed rather than kept behind an allowance.

Both files leave TEST_HELPER_BASELINE; the ratchet otherwise fails on the
unlowered entries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the resolver and the regex this pins, ran the suite locally at 13147e1 — looks correct to me.

  • scripts/availability-probes.test.mjs:43-51: the two return null arms (url === SITE_ORIGIN, !url.startsWith(SITE_ORIGIN + "/")) match the new assertions at lines 115-116, and the traversal case at 117 falls out of the resolve(root, rel) prefix check at line 49. Confirmed the body's claim that probeListProblems (line 61) rejects both URLs before the resolver ever sees them, so this fixture is the only thing exercising that contract.
  • scripts/page-markup.test.mjs:30-33: the ?? "" was unreachable — the alternation "([^"]*)"|'([^']*)'|([^\s"'>]+) has exactly one participating group per match, the quoted ones capture "" rather than undefined, and the unquoted one is +. Return type is unchanged (string | null), so hasAttr/rule callers are unaffected.
  • coverage-floor.test.mjs:177 demands deletion of a baseline entry that reaches 0, so removing the two lines is required, not optional.

node --test scripts/*.test.mjs → 794 pass / 0 fail locally (Node 26).

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 53ff534 into main Oct 28, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-clear-floor-availability-markup branch October 28, 2026 19:16
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#29413147e1` sha256:b841599927e19ac3ad7aaee237b78347518ef52daf32c73ad1c4afedc69b7446 — download from the dashboard or `hivectl review evidence #294`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants