test: cover the package.json script and CI command wiring contract - #278
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/workflow-scripts.test.mjs, asserting that every npm run target in a workflow or in another package.json script is defined, that every node scripts/... target and every linter config dotfile exists, that no scripts/*.mjs entry point is orphaned, and that a workflow running a validator also runs the unit suite. These references are plain strings naming files in other places, and no existing test reads package.json or any workflow, so a rename or deletion surfaces only when a contributor or CI runs the command. Closes #277 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
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 Hive will automatically remove the |
This was referenced Sep 18, 2026
[quality] docs/ and blog/ MDX component imports and CNCFProjectCard props have no unit coverage
#297
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds one new test-only file,
tests/workflow-scripts.test.mjs, covering thewiring contract between
package.jsonscripts, the files underscripts/,the linter config dotfiles those scripts name, and the
npm runinvocationsin
.github/workflows/*.yml.Files claimed by this PR:
tests/workflow-scripts.test.mjs(new, 7 tests).Nothing else — no production code, no workflow file, no
package.json, nolockfile, no dependency.
yamlis already a devDependency and is used to parsethe workflows rather than regexing YAML.
The gap
These four files refer to each other entirely through strings that name
something in another file:
node scripts/<f>.mjstargets,-c <dotfile>linter configs,
npm run <other>chains, and 19npm run <name>steps acrossthe workflows. No test in the repository reads
package.jsonor any workflow,so none of those references is checked. The existing suite spawns the
validators directly via
tests/helpers.mjs, which deliberately bypasses thenpm script layer — correct for those tests, but it leaves the layer CI and
contributors actually invoke unverified.
This has already bitten the repo:
npm run checkonce failed on a fresh clonebecause
.cspell.yml,.markdownlint.yamland.markdown-link-check.jsonwere named by scripts but absent. Assertion 5 below is the direct guard
against a repeat.
What the 7 assertions cover
npm run <name>in a workflow names a definedpackage.jsonscript.npm run <name>inside apackage.jsonscript names a definedscript — covers the
check/fix/seq/precheck:linkschains.Literal globs (
_list:check:*) and the barenpm run --loglevel=warnscript-listing idiom are excluded, with a comment saying why.
node scripts/...target inpackage.jsonexists on disk.-c/--configdotfile passed to a linter exists.scripts/*.mjsentry point is reachable from somepackage.jsonscript, so no entry point is orphaned.
validate:*script also runstest:unit.Verification
Run against a local clone of
cncf/endusersat00b44dfafternpm ci,node v22.
npm run test:unit: 62 pass, 0 fail (55 before; the 7 new tests are allthat changed).
npx prettier --check tests/workflow-scripts.test.mjs: clean.Mutation-checked — an assertion that cannot fail is not a test. Four
deliberate breakages were introduced and reverted:
validate:awards→node scripts/validate-awardz.mjscheck:spelling→-c .cspell-missing.ymlvalidate:metricsscripttest:unitfromdeploy-gh-pages.ymlAll 7 passed again after revert, and
git statusconfirmed the working treeclean apart from the new test file.
Known gaps deliberately not asserted
Two real problems in this repo would make a stricter version of this file fail
on
main, so they are not silently weakened into passing assertions — theyare filed instead:
ci.yml, the onlypull_requestworkflow, runs no validators, andvalidate:button-contrastruns in no workflow at all. An assertion for thatwould fail today. Filed as [quality] ci.yml PR gate runs no data validators; validate:button-contrast runs in no workflow #276, which has no PR because the fix is
inside
.github/workflows/and this agent's token cannot push workflowpaths.
scripts/validate-metrics.mjshas a malformed shebang (#!/usr bin/env node) andscripts/validate-button-contrast.mjshas none. A shebangassertion would fail on
main; the validate-metrics half is already beingfixed in open PR Fix malformed shebang in validate-metrics.mjs #200, which is production code and not this agent's to
duplicate.
Coverage evidence
npm run test:unitandnode --test --experimental-test-coverage,local clone at
00b44df, 2026-09-18.package.jsonand workflow YAML aredata, not executable modules, so they appear in no coverage report at any
percentage — this gap is invisible to
--experimental-test-coverageratherthan shown as a low number, which is part of why it persisted.
suite and publishes no coverage artifact from any suite (tracked in [quality] CI publishes no coverage evidence, so coverage findings cannot be verified #186).
No claim is made that these paths lack end-to-end coverage.
Disjointness
One new file, touched by no other open PR. Distinct from the data-file
contract tests (#235, #239, #241, #253, #257, #260, #270), the navigation
contract (#275), the per-script unit tests (#185, #197, #208, #214, #216,
#221, #231, #263), and the coverage reporter (#225) and JSX import path (#229),
both of which add lines to
package.json— this PR does not modifypackage.jsonat all, so it cannot conflict with either.Related Issue
Closes #277 — merging this leaves nothing for that issue to track: it asks for
exactly this file, and its three completion criteria (file exists and is picked
up by
npm run test:unit; each assertion mutation-checked; no production file,workflow or dependency modified) are all met above. The
ci.ymlproblem istracked separately in #276 and is not part of this issue.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5