Skip to content

test: repair architecture catalog fixture and cover the sourceUrl, id and asset rules from #334 - #398

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-architectures-sourceurl
Sep 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-architectures-sourceurl

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

npm run test:unit is red on main. .github/workflows/ci.yml runs it on every
pull_request, so the "Validate repository" check is failing on every open PR,
not just one.

dc5fe09 (#334) added three mandatory rules to scripts/validate-architectures.mjs
sourceUrl must be an https: URL, id must be a lowercase slug, and every
asset must resolve inside static/img/architectures/ — without updating the test
fixtures. The validRecord fixture has no sourceUrl, so the two tests that
assert status === 0 fail.

This PR touches tests/validate-architectures.test.mjs only. No production code.

Changes

Verification

Clean npm ci, node v26.8.2, at 60ddab0:

tests pass fail
before 345 341 2
after 354 352 0

npx prettier --check tests/validate-architectures.test.mjs passes.

The reported percentage for scripts/validate-architectures.mjs stays at
90.74% / 29.41%: these tests drive the validator through runScriptWithFixtures,
which spawns a subprocess, and node --test coverage discards subprocess data.
That attribution gap is #224 (PR #227/#225 territory), not something this PR claims
to fix — the branches are genuinely exercised, just not counted.

Overlap with open PRs

Open PR #212 also edits tests/validate-architectures.test.mjs, but only appends
MDX-active-content tests at end of file, and those tests reuse the same unfixed
validRecord — merging #212 alone will not turn CI green, and it will inherit the
fix from here. This PR inserts its tests before rejects assets missing from static/, above #212's append point, so the two should not conflict textually.
No other open PR touches this file.

Related Issue

Closes #397


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

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

… asset rules

PR #334 added mandatory sourceUrl, id-slug and asset-containment rules to
scripts/validate-architectures.mjs without updating the test fixtures. The
validRecord fixture has no sourceUrl, so 'accepts a valid catalog' and
'accepts records without an assets array' both fail, leaving npm run
test:unit red on main and the ci.yml 'Validate repository' check red on
every open PR.

Add sourceUrl to the fixture and cover the three rules #334 introduced:
sourceUrl absent / http: / javascript: / unparseable / non-string, a
non-slug id, and assets outside the prefix, escaping it via .., or not a
string.

Closes #397

Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit c09b952 Sep 21, 2026
2 checks passed
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] Unit suite is red on main: #334 added sourceUrl/id/asset rules without updating tests/validate-architectures.test.mjs

1 participant