Skip to content

test(e2e): make snapshot tests self-contained#302

Merged
branchseer merged 2 commits intomainfrom
add-argv-step-mode
Mar 28, 2026
Merged

test(e2e): make snapshot tests self-contained#302
branchseer merged 2 commits intomainfrom
add-argv-step-mode

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Mar 28, 2026

Why

Enable cross-compiling e2e snapshot tests and running them on another
machine (e.g. Windows VM via cargo-xtest). The target machine has no
guarantees about installed tools — no bash, no node, no system PATH.
Tests must be fully self-contained, relying only on the vt and vtt
binaries built by cargo.

Summary

Make e2e snapshot tests fully self-contained by removing all external
dependencies (bash, node, system PATH). Tests now spawn vt/vtt
directly without a shell wrapper.

  • Replace shell command strings with structured argv arrays in all fixtures
  • Add comment and envs fields to step config for metadata and env vars
  • Spawn processes directly via CommandBuilder instead of sh -c
  • Add vtt subcommands to replace external tools: pipe-stdin, write-file,
    cp, mkdir, rm, exit
  • Replace node usage in fixtures with vtt equivalents
  • Remove replay-logs-chronological-order fixture (required node)
  • Remove INSTA_REQUIRE_FULL_MATCH (incompatible with remote execution)
  • Document Conventional Commits format for PR titles in CLAUDE.md

🤖 Generated with Claude Code

Copy link
Copy Markdown
Member Author

branchseer commented Mar 28, 2026

@branchseer branchseer changed the title Add argv step spawn mode and cross-platform snapshot support for e2e tests feat(e2e): add argv step spawn mode and cross-platform snapshot support Mar 28, 2026
@branchseer branchseer changed the title feat(e2e): add argv step spawn mode and cross-platform snapshot support test(e2e): add argv step spawn mode and cross-platform snapshot support Mar 28, 2026
@branchseer branchseer force-pushed the add-argv-step-mode branch 3 times, most recently from ad91c93 to 786331f Compare March 28, 2026 11:21
@branchseer branchseer changed the title test(e2e): add argv step spawn mode and cross-platform snapshot support test(e2e): add argv step spawn mode Mar 28, 2026
@branchseer branchseer force-pushed the add-argv-step-mode branch 11 times, most recently from c4118ad to e185c1a Compare March 28, 2026 15:45
Replace shell string steps with structured argv format in all e2e test
fixtures. Steps now use `argv` arrays instead of shell command strings,
with optional `comment` and `envs` fields:

```toml
# Simple:
steps = [["vt", "run", "build"]]

# With metadata:
steps = [{ argv = ["vt", "run", "test"], comment = "cache miss", envs = [["MY_ENV", "1"]] }]

# Stdin piping via vtt helper (no shell):
steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "read-stdin"]]
```

Processes are spawned directly without a shell wrapper, avoiding shell
interference with signal handling and exit codes. Programs are resolved
from `CARGO_BIN_EXE_<name>` env vars. Shell redirects are replaced with
`vtt write-file` and `vtt pipe-stdin` helpers.

Also documents Conventional Commits format for PR titles in CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all `node` usages in e2e test fixtures with vtt subcommands:
- `node -e "process.exit(N)"` → `vtt exit N` (new subcommand)
- `node read_node_fs.js` → `vtt print` (test only needs a successful command)
- Remove `replay-logs-chronological-order` fixture (complex node script)

This eliminates the dependency on `node` being in PATH for e2e tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@branchseer branchseer changed the title test(e2e): add argv step spawn mode test(e2e): make snapshot tests self-contained Mar 28, 2026
@branchseer branchseer marked this pull request as ready for review March 28, 2026 16:40
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@branchseer branchseer merged commit 3a46fd0 into main Mar 28, 2026
9 checks passed
@branchseer branchseer deleted the add-argv-step-mode branch March 28, 2026 16:41
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