Skip to content

fix(integration-tests): use spawnSync to capture stdout+stderr (CI fix)#411

Merged
bakeb7j0 merged 1 commit into
kahuna/390-bug-drainfrom
fix/integration-tests-spawnsync
May 6, 2026
Merged

fix(integration-tests): use spawnSync to capture stdout+stderr (CI fix)#411
bakeb7j0 merged 1 commit into
kahuna/390-bug-drainfrom
fix/integration-tests-spawnsync

Conversation

@bakeb7j0
Copy link
Copy Markdown
Contributor

@bakeb7j0 bakeb7j0 commented May 6, 2026

Summary

Follow-up to PR #410. The execSync(cmd 2>&1) approach didn't work in GitHub Actions runners — gh --help still produced empty output even with stderr merged. Switching to spawnSync which gives separate stdout/stderr buffers we can concatenate.

Also unsets pager environment variables (GH_PAGER, PAGER, GLAB_PAGER) to defeat any pager-detection short-circuiting — some gh versions check terminal capabilities and suppress --help output if pagination is unavailable.

Changes

  • tests/integration/cli-flag-shapes.test.ts:
    • captureHelp() now uses spawnSync instead of execSync
    • Concatenates result.stdout + result.stderr
    • Unsets pager env vars

Tests

Why this matters

PR #410's first attempt didn't work because shell-level 2>&1 doesn't capture output that gh writes via TTY-aware paths. spawnSync bypasses the shell entirely and captures the actual file descriptors.

The execSync(cmd 2>&1) approach didn't work in GitHub Actions runners
— gh --help still produced empty output even with stderr merged. Switch
to spawnSync which gives separate stdout/stderr buffers we can
concatenate. Also unset PAGER vars to defeat any pager-detection
short-circuiting (some gh versions check terminal capabilities and
suppress --help output if pagination is unavailable).

This is a follow-up to the prior captureHelp commit on this branch.
@bakeb7j0 bakeb7j0 merged commit 5d30c9b into kahuna/390-bug-drain May 6, 2026
1 check failed
@bakeb7j0 bakeb7j0 deleted the fix/integration-tests-spawnsync branch May 6, 2026 01:59
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