Skip to content

test: add E2E tests for engine stdio piping#52

Merged
anandgupta42 merged 2 commits intomainfrom
engine-stdio-piping-tests
Mar 5, 2026
Merged

test: add E2E tests for engine stdio piping#52
anandgupta42 merged 2 commits intomainfrom
engine-stdio-piping-tests

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

Summary

  • Adds E2E tests verifying execFileSync calls in engine.ts use { stdio: "pipe" } to prevent subprocess output from leaking into the TUI
  • Tests spawn real child processes with real commands (echo, python3 --version, tar --version) and assert captured stdout/stderr is clean
  • Includes control tests proving output DOES leak without stdio: "pipe", and a source-level check that all 6 call sites in engine.ts have the option set

Test plan

  • bun test test/bridge/engine.test.ts — 6 tests pass
  • bun test test/bridge/ — all 13 tests pass (no interference with existing client.test.ts)

🤖 Generated with Claude Code

Verify that all execFileSync calls in engine.ts use { stdio: "pipe" }
to prevent subprocess output (uv, pip install, python --version, etc.)
from leaking into the TUI's text input area.

Tests use real subprocess calls via spawnSync to confirm the piping
behavior end-to-end, plus a source-level check that every call site
in engine.ts includes the stdio option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +125 to +127
for (const site of callSites) {
expect(site.text).toContain('stdio: "pipe"')
}

This comment was marked as outdated.

Without this option, subprocess output from uv, pip install, tar, and
python/uv --version leaks into the TUI's text input area. Piping stdio
suppresses this noise while still capturing the return value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anandgupta42 anandgupta42 merged commit 339f2c0 into main Mar 5, 2026
5 checks passed
anandgupta42 added a commit that referenced this pull request Mar 17, 2026
* test: add E2E tests for engine.ts stdio piping

Verify that all execFileSync calls in engine.ts use { stdio: "pipe" }
to prevent subprocess output (uv, pip install, python --version, etc.)
from leaking into the TUI's text input area.

Tests use real subprocess calls via spawnSync to confirm the piping
behavior end-to-end, plus a source-level check that every call site
in engine.ts includes the stdio option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add stdio: "pipe" to all execFileSync calls in engine.ts

Without this option, subprocess output from uv, pip install, tar, and
python/uv --version leaks into the TUI's text input area. Piping stdio
suppresses this noise while still capturing the return value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant