Skip to content

test(snapshots): migrate the command-* toolchain cases to the PTY snapshot suite#2138

Merged
graphite-app[bot] merged 1 commit into
mainfrom
migrate-command-toolchain-snap-tests
Jul 10, 2026
Merged

test(snapshots): migrate the command-* toolchain cases to the PTY snapshot suite#2138
graphite-app[bot] merged 1 commit into
mainfrom
migrate-command-toolchain-snap-tests

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jul 10, 2026

Copy link
Copy Markdown
Member

Migrates the ~112 toolchain command-* cases (cache, check, config, dev,
dlx, doc, env, exec, fmt, helper, info, init, lint, nested, node, pack,
pm, preview, rebuild, run, staged, upgrade, version, vp-alias, vpr, vpx)
from both legacy trees, and removes the legacy dirs. Same-name cases that
existed in both trees merge as vp = ["local", "global"].

Hand conversions follow the established idioms: redirects and
2>&1 | grep wrappers become plain steps the snapshot asserts,
rm -rf *.tgz globs become explicit deterministic tarball names,
printf/appends become vpt write-file, || chains become vpt
grep-file/stat-file, tool json-sort and shell pipelines become node -e
scripts (which may exec vp themselves), and vp exec -c/vp dlx -c
pass their shell commands through vp's own shell handling. Steps that hit
interactive prompts under a PTY (vp config agent updates, vp run
missing-script suggestions, the npm link hint) run with tty = false,
matching the legacy runner's piped stdio.

Runner changes: a ./-prefixed argv[0] resolves relative to the step
cwd so a case can run the executable it packed; the local-registry server
now starts from the case root instead of the staged workspace, so a
fixture's pinned old Node (a .node-version under test) cannot pick the
runtime executing the TypeScript helper. Registry-bound fixtures declare
local-registry = true. New redaction rules mask the proxy's ephemeral
port (http:// anchored so help-text hosts stay verbatim), npm's
timestamped debug-log name, live spinner frames, and pnpm's
nondeterministic progress lines.

command-env-setup-external-vp stays in the legacy tree: it rebinds
VP_HOME to a workspace-relative path via shell expansion, which static
step envs cannot express.

Part of #2116.

@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit c20b931
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a50fc51e7f73b000824315e

fengmk2 commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@graphite-app

graphite-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merge activity

…napshot suite (#2138)

Migrates the ~112 toolchain command-* cases (cache, check, config, dev,
dlx, doc, env, exec, fmt, helper, info, init, lint, nested, node, pack,
pm, preview, rebuild, run, staged, upgrade, version, vp-alias, vpr, vpx)
from both legacy trees, and removes the legacy dirs. Same-name cases that
existed in both trees merge as vp = ["local", "global"].

Hand conversions follow the established idioms: redirects and
`2>&1 | grep` wrappers become plain steps the snapshot asserts,
`rm -rf *.tgz` globs become explicit deterministic tarball names,
printf/appends become vpt write-file, || chains become vpt
grep-file/stat-file, `tool json-sort` and shell pipelines become node -e
scripts (which may exec vp themselves), and `vp exec -c`/`vp dlx -c`
pass their shell commands through vp's own shell handling. Steps that hit
interactive prompts under a PTY (vp config agent updates, vp run
missing-script suggestions, the npm link hint) run with tty = false,
matching the legacy runner's piped stdio.

Runner changes: a `./`-prefixed argv[0] resolves relative to the step
cwd so a case can run the executable it packed; the local-registry server
now starts from the case root instead of the staged workspace, so a
fixture's pinned old Node (a .node-version under test) cannot pick the
runtime executing the TypeScript helper. Registry-bound fixtures declare
local-registry = true. New redaction rules mask the proxy's ephemeral
port (http:// anchored so help-text hosts stay verbatim), npm's
timestamped debug-log name, live spinner frames, and pnpm's
nondeterministic progress lines.

command-env-setup-external-vp stays in the legacy tree: it rebinds
VP_HOME to a workspace-relative path via shell expansion, which static
step envs cannot express.

Part of #2116.
@graphite-app graphite-app Bot force-pushed the migrate-command-toolchain-snap-tests branch from 24087b4 to c20b931 Compare July 10, 2026 14:06
@graphite-app graphite-app Bot merged commit c20b931 into main Jul 10, 2026
52 checks passed
@graphite-app graphite-app Bot deleted the migrate-command-toolchain-snap-tests branch July 10, 2026 14:13
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