Skip to content

[quality] validate-schema.mjs: cover runValidation (0% -> 53%) - #3233

Merged
hivecommons-hive[bot] merged 1 commit into
masterfrom
quality/validate-schema-runvalidation-1788697991
Sep 11, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
masterfrom
quality/validate-schema-runvalidation-1788697991

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds 10 tests for runValidation, the exported dispatcher used by the schema-validation CI workflow.

Previously the only test file for this module (__tests__/validate-schema.test.mjs) only exercised scanner.mjs's validateMissionExport, leaving runValidation at 0% coverage.

Covers

  • valid JSON mission → success path
  • .yaml / .yml missions dispatched to yaml.load
  • extensionless files → JSON-first, YAML fallback branch
  • read-file error → invalid count + stderr message
  • JSON parse error → invalid count + 'Parse error'
  • YAML parse error → invalid count + 'Parse error'
  • schema-validation failure → per-error bullets on stderr
  • mixed batch aggregates counts correctly
  • empty file list → zeroed counts

Coverage

scripts/validate-schema.mjs: 0% → 53.03% lines / 35.48% branches. The remaining 47% is discoverMissionFiles and main(), both driven by process.argv / process.exit and better exercised via a follow-up.

Refs #3165


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

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

Adds 10 tests for runValidation, the exported dispatcher used by the
schema-validation CI workflow. Previously the only test file for this
module (__tests__/validate-schema.test.mjs) only exercised
scanner's validateMissionExport, leaving runValidation at 0% coverage.

Covers:
- valid JSON mission → success path
- .yaml / .yml missions dispatched to yaml.load
- extensionless files → JSON-first, YAML fallback
- read-file error → invalid count + stderr message
- JSON parse error → invalid count + 'Parse error'
- YAML parse error → invalid count + 'Parse error'
- schema-validation failure → per-error bullets on stderr
- mixed batch aggregates counts correctly
- empty file list → zeroed counts

Coverage of validate-schema.mjs: 0% -> 53.03% lines, 35.48% branches.
Refs #3165

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

Copy link
Copy Markdown
Contributor Author

Important

Held for human sign-off on the direction, not on the code.

This PR's only tracked rationale is #3165, which the hive filed itself — issue #3165 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117).

The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the approved-direction label — and remove the hold label here.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 6, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[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 clubanderson 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 6, 2026
@clubanderson clubanderson removed the hold label Sep 11, 2026
@clubanderson

Copy link
Copy Markdown
Member

Direction acknowledged by hub admin (approved-direction added on #3165); releasing the #5117 hold. This hive runs at ACMM L6 and may act on its own findings.

@hivecommons-hive
hivecommons-hive Bot merged commit 0b5155c into master Sep 11, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/validate-schema-runvalidation-1788697991 branch September 11, 2026 16:54
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants