fix(integration-tests): capture stderr in CLI --help (unblock CI)#410
Merged
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom May 6, 2026
Merged
Conversation
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.
This was referenced May 6, 2026
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.
Summary
The integration tests added by #387 (PR #393) capture
gh/glab--helpoutput viaexecSync. On local dev environments these binaries write--helpto stdout; on GitHub Actions runners (Ubuntu)ghwrites--helpto stderr, soexecSynccaptures an empty string and every flag-presence assertion fails.This is blocking the kahuna→main merge for plan #390 (PR #402): the
validateworkflow check fails on 15 integration tests.Changes
captureHelp()helper that runs the command with2>&1(merge stderr into stdout)execSync(<cmd> --help, ...)calls intests/integration/cli-flag-shapes.test.tswithcaptureHelp(...)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.