Skip to content

test: cover run-sync-step CLI entry in process (argv guard, usage exit 2, exit-code propagation) - #243

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-run-sync-step-entry
Oct 6, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-run-sync-step-entry

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/run-sync-step.main.test.ts, which drives the CLI entry of scripts/run-sync-step.ts (the prebuild sync gate from #240) in process — the same technique scripts/check-internal-links.main.test.ts uses — so v8 attributes coverage to the script itself:

  • vi.mock("node:child_process") so no real tsx child is spawned
  • process.exit stubbed to throw, process.argv set per case, vi.resetModules() + dynamic import

Seven cases: library import is a no-op; missing argument → usage + exit 2; success spawns tsx <script> with stdio: "inherit" / env: process.env / platform-correct shell and exits 0; child exit 3 propagates; signal-killed child (status null) → exit 1; DOCS_SYNC_OPTIONAL=1 tolerates failure with the exact warning text; DOCS_SYNC_OPTIONAL=true does not.

file before after
scripts/run-sync-step.ts lines 61.53% (37–42 uncovered) 100%

Full suite: 89 files / 865 tests green; eslint, tsc --noEmit, prettier --check clean. No production code touched.

Closes #242


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

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

…t 2, exit-code propagation)

The prebuild gate from #240 had its entry block (lines 37-42) untested;
only the exported helpers were exercised via an injected fake spawn, and
the spawn invocation shape was never asserted. Drive the entry in process
(vi.mock node:child_process, process.exit stub, vi.resetModules + dynamic
import) following check-internal-links.main.test.ts so v8 attributes the
coverage to the script. run-sync-step.ts goes 61.5% -> 100% lines.

Closes #242

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@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 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

@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit c8c0c16
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ac4a146a992a000085c2346
😎 Deploy Preview https://deploy-preview-243--hivecommons-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive
hivecommons-hive Bot merged commit 31f2b12 into main Oct 6, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-run-sync-step-entry branch October 6, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] scripts/run-sync-step.ts: prebuild CLI entry (argv guard, usage exit 2, exit-code propagation) is untested — 61.5% lines

0 participants