Skip to content

fix(integration-tests): capture stderr in CLI --help (unblock CI)#410

Merged
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom
fix/integration-tests-capture-stderr
May 6, 2026
Merged

fix(integration-tests): capture stderr in CLI --help (unblock CI)#410
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom
fix/integration-tests-capture-stderr

Conversation

@bakeb7j0
Copy link
Copy Markdown
Contributor

@bakeb7j0 bakeb7j0 commented May 6, 2026

Summary

The integration tests added by #387 (PR #393) capture gh/glab --help output via execSync. On local dev environments these binaries write --help to stdout; on GitHub Actions runners (Ubuntu) gh writes --help to stderr, so execSync captures an empty string and every flag-presence assertion fails.

This is blocking the kahuna→main merge for plan #390 (PR #402): the validate workflow check fails on 15 integration tests.

Changes

  • Added a captureHelp() helper that runs the command with 2>&1 (merge stderr into stdout)
  • Replaced all 18 execSync(<cmd> --help, ...) calls in tests/integration/cli-flag-shapes.test.ts with captureHelp(...)

Tests

Why this matters

The integration tests exist specifically to catch CLI flag drift (#382, #383, pr_wait_ci). They have to actually RUN successfully in CI to provide value — a test that fails for environmental reasons is no better than a missing test.

The integration tests added by #387 use execSync to capture --help
output from gh and glab. On local dev environments these binaries
write --help to stdout; on GitHub Actions runners (Ubuntu) gh writes
--help to stderr, so execSync captures an empty string and every
flag-presence assertion fails.

Added a captureHelp() helper that uses '2>&1' to merge stderr into
stdout. Replaced all 18 execSync(<cmd> --help) invocations with
captureHelp(<cmd> --help). The helper is the only difference between
the prior (locally-passing) and CI-passing forms.

This unblocks the kahuna→main merge for plan #390.
@bakeb7j0 bakeb7j0 merged commit 0f1e1bb into kahuna/390-bug-drain May 6, 2026
1 check failed
@bakeb7j0 bakeb7j0 deleted the fix/integration-tests-capture-stderr branch May 6, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants