Skip to content

test(cli): --status regression test reaches the TTY branch via an isTTY shim - #354

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-status-tty-regression
Oct 26, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-status-tty-regression

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

The regression test added in #351 ("--status alone never prompts or errors on an unfilled blank") spawns cli.js with piped stdin, so process.stdin.isTTY is never true and interactive is already false with or without the !statusOnly term the test is meant to guard. Reverting that one-line fix left the suite green (512/512).

This PR adds --status never asks even when stdin is a TTY, which spawns the CLI with
--import 'data:text/javascript,Object.defineProperty(process.stdin,"isTTY",{value:true})' so the TTY branch is reached without a pty (works on both the ubuntu and macOS matrix legs). A positive control in the same test runs the identical shim without --status and asserts the ask path fails with the stdin is closed diagnostic, so the --status assertion cannot be satisfied vacuously.

Validation at 8d26afe, Node v26.12.0:

  • npm test — 513/513 pass, coverage 99.60% lines / 97.69% branches / 100% functions (gate unchanged)
  • mutation check: with the !statusOnly term removed from dist/cli.js, the new test fails (actual: 1, expected 0); the pre-existing test still passed
  • dist/cli.test.js + .map regenerated for the dist-sync gate; changelog.d/added-status-tty-regression-test.md added

Closes #353


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

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

…TY shim

The test added in #351 spawns cli.js with piped stdin, so isTTY is never
true and the test passes with or without the !statusOnly fix it guards.
Preload a data: module that reports stdin as a TTY so the interactive
decision is observable, and keep a positive control showing the same
shim without --status takes the ask path.

Closes #353

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 26, 2026
@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

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 26, 2026
@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 26, 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.

Read against src/cli.ts and src/resolver.ts at main: the test does what it claims and looks correct to me.

  • src/cli.ts:118 — interactive = !flags['no-interactive'] && !statusOnly && process.stdin.isTTY === true. The --import data: shim sets isTTY to true on the spawned process before cli.js loads, so this is the first test that actually evaluates the !statusOnly term rather than short-circuiting on isTTY.
  • src/resolver.ts:230-237 — with input: '' stdin hits EOF immediately, rl.on('close') fires and rejects with Variable "file" has no value and stdin is closed, which is exactly the positive-control assertion. Deterministic, no timing dependence.
  • The positive control (exit 1 without --status) is the important half: it is what makes the --status assertion falsifiable if someone drops !statusOnly from the condition.
  • --import with a data: URL needs Node ≥ 20.6; engines.node is >=22 and the CI matrix is 22/24/26, so no portability concern.
  • dist/cli.test.js + .map are committed, which the dist-sync gate requires; verify is green.

Test-only change plus changelog fragment. Not approving — that needs a human signature.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 5d54d0b into main Oct 26, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-status-tty-regression branch October 26, 2026 23:21
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#354cd2b46b` sha256:42753d883f1210a717746eb5be511859aed48c90debb2c3cfcacd02f11b531f5 — download from the dashboard or `hivectl review evidence #354`.

@github-actions

Copy link
Copy Markdown

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

We'd love to hear how your experience was: share feedback

@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 26, 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 copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] #351 --status regression test cannot fail: TTY branch unreachable with piped stdin

0 participants