Skip to content

chore(ci): add snap test sharding with --shard=X/Y support#1189

Merged
fengmk2 merged 6 commits intomainfrom
snap-test-sharding
Mar 30, 2026
Merged

chore(ci): add snap test sharding with --shard=X/Y support#1189
fengmk2 merged 6 commits intomainfrom
snap-test-sharding

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Mar 28, 2026

Add Vitest-style --shard option to the snap test runner to split tests
across multiple CI runners. The new cli-snap-test job runs 3 shards per
OS (9 total matrix entries), reducing snap test wall-clock time by ~65%.

The cli-e2e-test job now runs only unit tests, while snap tests are
handled exclusively by the sharded cli-snap-test job.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 52cc58b
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c9f3605a0efd0008ae8438

@fengmk2 fengmk2 self-assigned this Mar 28, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 28, 2026


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.

- os: namespace-profile-linux-x64-default
target: x86_64-unknown-linux-gnu
shard: 3
shardTotal: 3

Check warning

Code scanning / zizmor

detects commit SHAs that don't match their version comment tags Warning

detects commit SHAs that don't match their version comment tags
target: x86_64-unknown-linux-gnu
shard: 2
shardTotal: 3
- os: namespace-profile-linux-x64-default

Check notice

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Note

credential persistence through GitHub Actions artifacts
fengmk2 added 5 commits March 29, 2026 22:51
Add Vitest-style --shard option to the snap test runner to split tests
across multiple CI runners. The new cli-snap-test job runs 3 shards per
OS (9 total matrix entries), reducing snap test wall-clock time by ~65%.

The cli-e2e-test job now runs only unit tests, while snap tests are
handled exclusively by the sharded cli-snap-test job.
The `pnpm script -- --shard=1/3` syntax passes `--` through to the
script, causing parseArgs to treat `--shard` as a positional (filter)
instead of an option. Use `pnpm -F ./packages/cli` to run scripts
directly, which passes args without the `--` separator.
Tests using npm global operations (link, outdated -g, unlink) fail with
ENOENT when sharded because the NPM_CONFIG_PREFIX directory was only
implicitly created by whichever test ran `npm install -g` first. With
sharding, that test may be in a different shard.
npm expects a `lib/` subdirectory inside NPM_CONFIG_PREFIX for global
operations like link and outdated -g.
@fengmk2 fengmk2 force-pushed the snap-test-sharding branch from 60903f6 to 2ddac25 Compare March 29, 2026 14:53
@fengmk2 fengmk2 marked this pull request as ready for review March 29, 2026 15:05
@fengmk2 fengmk2 requested a review from cpojer March 30, 2026 02:07
@fengmk2 fengmk2 merged commit 109fca0 into main Mar 30, 2026
35 checks passed
@fengmk2 fengmk2 deleted the snap-test-sharding branch March 30, 2026 04:02
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.

3 participants