Skip to content

test: pin 410, soft-404 variants, fonts skip and html_escape in the shell self-tests - #257

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-shell-checker-arms
Oct 25, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-shell-checker-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Four arms of the shell checkers had no self-test that failed when the arm was removed (verified by mutation on main @ f930ed0 — each mutant passed scripts/check-links.test.sh 106/106 and scripts/check-redirects.test.sh 28/28):

Script Arm Why it was unasserted
scripts/check-links.sh "$code" == "410" → external broken fake curl never returned 410
scripts/check-links.sh SOFT_404_RE alternatives >404< and doesn't exist or has moved only Page Not Found was exercised
scripts/check-links.sh skip of https://fonts.googleapis.com / https://fonts.gstatic.com fake curl answered 200 for them, so a deleted skip still passed
make-redirects.sh html_escape of <, >, " fixture MAP has no special characters; the real MAP has & but no < > ", so check-redirects.sh on the tree passed too

This PR adds:

  • fake curl: 410 for *withdrawn*, bodies for the two other soft-404 patterns, and a hard 404 for any probe of a fonts origin so a dropped skip fails the existing clean-site case too
  • check-links.test.sh: cases "410 Gone and every soft-404 body pattern are external failures" and "Google Fonts preconnect origins are skipped, not probed"
  • check-redirects.test.sh: write_generator takes extra MAP entries; new case feeds the real template a URL and label containing & < > " and asserts the escaped refresh/canonical/href attributes, <title> and link text, that no raw character leaks, and that the page stays byte-stable under the gate

Re-running the four mutations against this branch fails 2, 3, 4 and 3 assertions respectively. Suite: check-links 114/114, check-redirects 32/32, node --test scripts/*.test.mjs 740/740.

No production file changes; the .mjs helpers are already under coverage-floor.test.mjs, this closes the same class of gap for the two bash gates it cannot see.


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

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

…hell self-tests

check-links.sh treats HTTP 410 as broken, matches three soft-404 body
patterns and skips the Google Fonts preconnect origins; make-redirects.sh
HTML-escapes & < > " in URLs and labels. None of those arms had a
fixture that failed when the arm was removed: the fake curl never returned
410, only 'Page Not Found' was exercised, a probe of fonts.googleapis.com
answered 200, and the fixture MAP carried no special characters (the real
MAP has & but no < > ", so check-redirects.sh on the tree passes too).

- fake curl: 410 for *withdrawn*, the two other SOFT_404_RE bodies, and a
  hard 404 for any probe of fonts.googleapis.com / fonts.gstatic.com so a
  dropped skip fails the clean-site case rather than passing silently
- new check-links cases: '410 Gone and every soft-404 body pattern',
  'Google Fonts preconnect origins are skipped, not probed'
- write_generator accepts extra MAP entries; new check-redirects case feeds
  the real template a URL and label containing & < > " and asserts the
  escaped refresh/canonical/anchor attributes, title and link text, that
  no raw character leaks, and that the page is byte-stable under the gate

Each case was verified by mutation: removing 410, shrinking SOFT_404_RE,
deleting the fonts skip, or dropping the < and " escapes now fails the
corresponding self-test (106 -> 114 and 28 -> 32 assertions).

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 25, 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.

Looks correct to me — test-only change, and the new cases do pin the arms they claim to.

What I verified on 611ac1d:

  • The arms under test exist as described: scripts/check-links.sh:18 (SOFT_404_RE with the >404< and doesn't exist or has moved alternatives), :229 (fonts preconnect skip), :240 (410 → external failure); make-redirects.sh:25-37 (html_escape applied to both label and url, & escaped first so &lt;/&quot; are not double-escaped).
  • Both suites pass on this head: check-links 114/114, check-redirects 32/32.
  • Mutations: commenting out the fonts skip (check-links.sh:229-231) fails 5 assertions, including the pre-existing "clean site passes" case as the body says; deleting the " → &quot; line (make-redirects.sh:30) fails 2 assertions in the new escape case. Both mutants passed before this PR.
  • write_generator change (check-redirects.test.sh:26-37) is backward-compatible: with no extra args printf ' %s\n' "$@" emits nothing and the two-entry fixture is unchanged, which the untouched existing cases confirm.

No production files change. Nothing blocking from me.

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

@hivecommons-hive
hivecommons-hive Bot merged commit d4f06ec into main Oct 25, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-shell-checker-arms branch October 25, 2026 06:27
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#257611ac1d` sha256:a68a642e26e6b6e52c1d12e2a987da42270823e2704c571a15d6ebb1c41cef7b — download from the dashboard or `hivectl review evidence #257`.

@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 25, 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/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants