Skip to content

test(ai): share Vitest config#15407

Merged
gr2m merged 1 commit into
mainfrom
ci/share-provider-vitest-configs
May 18, 2026
Merged

test(ai): share Vitest config#15407
gr2m merged 1 commit into
mainfrom
ci/share-provider-vitest-configs

Conversation

@gr2m
Copy link
Copy Markdown
Collaborator

@gr2m gr2m commented May 18, 2026

Background

ai has duplicate node/edge Vitest config. Fixes #15405.

Summary

  • move shared ai Vitest settings to vitest.config.js
  • keep node/edge wrappers for existing scripts

Manual Verification

  • pnpm run check
  • pnpm --dir packages/ai test:node --shard 1/4
  • pnpm --dir packages/ai test:edge --shard 1/4

Impact

CI run 26049760221 passed.

No speed win expected; this is cleanup/enabler only.

Measured Run tests:

  • Node 20: 428s
  • Node 22: 379s
  • Node 24: 349s

Roughly baseline range.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixes #15405

Move common node and edge Vitest settings into one helper while preserving the existing package scripts.

Fixes #15405

Co-authored-by: Cursor <cursoragent@cursor.com>
@gr2m gr2m merged commit 492ef8e into main May 18, 2026
19 checks passed
@gr2m gr2m deleted the ci/share-provider-vitest-configs branch May 18, 2026 19:08
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 20, 2026
## Summary

Bundles the intent of eight main-branch CI PRs from May 18 into
`release-v5.0`. Each PR was manually adapted to v5's CI structure rather
than cherry-picked, because v5 still uses `@vN`-tag action refs (not SHA
pins), keeps the Node 20/22/24 matrix, has a flatter \`ci.yml\` (no
\`konsistent\` job), and runs the load-time benchmark from
\`examples/ai-core\` (not \`ai-functions\`).

### Backported

- #15400 \`ci: reuse package builds in test jobs\` — adds a
\`build-packages\` job that uploads \`packages/*/dist\`;
test/bundle-size/load-time jobs download instead of rebuilding.
- #15407 \`test(ai): share Vitest config\` — extracts
\`packages/ai/vitest.config.js\` factory.
- #15404 \`ci: shard ai and codemod tests\` — adds \`test_ai_matrix\` +
\`test_codemod_matrix\` (4 shards × Node 20/22/24); excludes ai +
codemod from regular Test matrix via \`pnpm test:ci\`.
- #15411 \`ci: narrow PR test node matrix\` — adds
\`test_node_versions\` planner; PRs without package source/test changes
use Node 22 only.
- #15409 \`ci: gate RSC Playwright tests\` — detects RSC-relevant PR
changes; skips Playwright install + sets \`SKIP_RSC_E2E=1\` when
irrelevant.
- #15417 \`ci: delete obsolete discussion workflows\` — no-op for
workflow deletes (already absent on v5); adds \`SKIP_RSC_E2E\` env to
relevant turbo tasks.
- #15418 \`ci: notify about failures on main and release branches\` —
adds CI to the Slack workflow_run watchlist with a branch filter;
corrects a verify-changesets comment.
- #15419 \`ci: speed build build-examples job\` — shards
\`build-examples\` into 4 with build caching.

### Not backported (per request)

- #15390 (bump min Node to 22 — breaking change)
- #15389 (dependency updates)
- #15421 (refactor: introduce agent UI message generic)

### Adaptations to v5

- Kept Node \`[20, 22, 24]\` everywhere (no jump to \`[22, 24, 26]\`).
- Used tag-style action refs (\`actions/checkout@v6\` etc.) instead of
main's pinned SHAs.
- Skipped the \`konsistent\` job since v5's ci.yml never had it.
- Load-time job runs from \`examples/ai-core\` with v5's existing
thresholds (ai max 95ms).
- Build-examples shard filters use v5's example names (e.g. includes
\`@example/next-openai\` which exists on v5 but not on main; uses
\`@example/next-openai-upstash-rate-limits\` to match v5's package name;
omits \`@example/next-workflow\`).
- Discussion workflows already absent on v5, so only the turbo.json
portion of #15417 applies.

## Test plan

- [ ] CI passes on this PR
- [ ] \`Test\` jobs run \`pnpm test:ci\` (regular packages, excludes
ai/codemod)
- [ ] \`Test AI\` runs 4 shards × Node 20/22/24
- [ ] \`Test Codemod\` runs 4 shards × Node 20/22/24
- [ ] PRs without package source changes get Node 22-only Test matrix
- [ ] Non-RSC changes skip Playwright install
- [ ] Build-examples shards complete in parallel with cache restore
gr2m added a commit that referenced this pull request May 20, 2026
## Summary

Bundles the intent of eight main-branch CI PRs from May 18 into
`release-v6.0`. Each PR was manually adapted to v6's CI structure rather
than cherry-picked, because v6 still uses `@vN`-tag action refs (not SHA
pins), keeps the Node 20/22/24 matrix, and has a flatter `ci.yml` (no
\`konsistent\` job).

### Backported

- #15400 \`ci: reuse package builds in test jobs\` — adds a
\`build-packages\` job that uploads \`packages/*/dist\`;
test/bundle-size/load-time jobs download instead of rebuilding.
- #15407 \`test(ai): share Vitest config\` — extracts
\`packages/ai/vitest.config.js\` factory.
- #15404 \`ci: shard ai and codemod tests\` — adds \`test_ai_matrix\` +
\`test_codemod_matrix\` (4 shards × Node 20/22/24); excludes ai +
codemod from regular Test matrix via \`pnpm test:ci\`.
- #15411 \`ci: narrow PR test node matrix\` — adds
\`test_node_versions\` planner; PRs without package source/test changes
use Node 22 only.
- #15409 \`ci: gate RSC Playwright tests\` — detects RSC-relevant PR
changes; skips Playwright install + sets \`SKIP_RSC_E2E=1\` when
irrelevant.
- #15417 \`ci: delete obsolete discussion workflows\` — deletes
\`discussions-auto-close-{new,stale}.yml\`; adds \`SKIP_RSC_E2E\` env to
relevant turbo tasks.
- #15418 \`ci: notify about failures on main and release branches\` —
adds CI to the Slack workflow_run watchlist with a branch filter;
corrects a verify-changesets comment.
- #15419 \`ci: speed build build-examples job\` — shards
\`build-examples\` into 4 with build caching.

### Not backported (per request)

- #15390 (bump min Node to 22 — breaking change)
- #15389 (dependency updates)
- #15421 (refactor: introduce agent UI message generic)

### Adaptations to v6

- Kept Node \`[20, 22, 24]\` everywhere (no jump to \`[22, 24, 26]\`).
- Used tag-style action refs (\`actions/checkout@v6\` etc.) instead of
main's pinned SHAs.
- Skipped the \`konsistent\` job since v6's ci.yml never had it.
- Build-examples shard filters mirror main; missing examples on v6 (e.g.
\`@example/next-workflow\`) become no-ops under turbo filters.
- Load-time job continues to use \`examples/ai-functions\` with v6's
existing thresholds (ai max 100ms).

## Test plan

- [ ] CI passes on this PR
- [ ] \`Test\` jobs run \`pnpm test:ci\` (regular packages, excludes
ai/codemod)
- [ ] \`Test AI\` runs 4 shards × Node 20/22/24
- [ ] \`Test Codemod\` runs 4 shards × Node 20/22/24
- [ ] PRs without package source changes get Node 22-only Test matrix
- [ ] Non-RSC changes skip Playwright install
- [ ] Build-examples shards complete in parallel with cache restore
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.

CI: share Vitest configs for node and edge tests

1 participant