Skip to content

test(e2e): isolate sync option-routing children from ambient NODE_OPTIONS - #109

Merged
sjsyrek merged 1 commit into
mainfrom
fix/e2e-env-isolation
Jul 29, 2026
Merged

test(e2e): isolate sync option-routing children from ambient NODE_OPTIONS#109
sjsyrek merged 1 commit into
mainfrom
fix/e2e-env-isolation

Conversation

@sjsyrek

@sjsyrek sjsyrek commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the environment-dependent failure in cli-sync-option-routing.e2e.test.ts: the runCli helper spread process.env into the spawned CLI process, so a shell whose NODE_OPTIONS causes node to print a startup warning ((node:<pid>) …) polluted stderr ahead of the JSON error envelope, breaking JSON.parse in the --format json assertion.

Changes Made

  • runCli child env now drops NODE_OPTIONS and sets NODE_NO_WARNINGS=1, matching cli-cache-degraded.e2e.test.ts's existing handling.

Test Coverage

Reproduced deterministically with NODE_OPTIONS='--require <script calling process.emitWarning>': 1 failed / 19 passed before the fix, 20/20 after, and 20/20 in a clean environment. This is the only e2e suite that parses stderr as JSON.

Backward Compatibility

✅ Test-only change; no production code touched.

Size: Small ✓

🤖 Generated with Claude Code

…IONS

The runCli helper spread process.env into the spawned CLI, so a shell whose
NODE_OPTIONS makes node print a startup warning polluted stderr ahead of the
JSON error envelope and broke JSON.parse in the --format json assertion.
Reproduced with NODE_OPTIONS='--require <emit-warning script>': 1 failed /
19 passed before, 20/20 after. The child now drops NODE_OPTIONS and sets
NODE_NO_WARNINGS, matching cli-cache-degraded's handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sjsyrek
sjsyrek merged commit 527dd22 into main Jul 29, 2026
5 checks passed
@sjsyrek
sjsyrek deleted the fix/e2e-env-isolation branch July 29, 2026 18:52
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