Skip to content

ci: shard package-local test suites - #6327

Open
jgoux wants to merge 8 commits into
developfrom
ci/shard-package-local-tests
Open

ci: shard package-local test suites#6327
jgoux wants to merge 8 commits into
developfrom
ci/shard-package-local-tests

Conversation

@jgoux

@jgoux jgoux commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move TypeScript unit, integration, and end-to-end execution to package-local Vitest scripts orchestrated by Turbo while keeping live tests separate.
  • Run unit and integration suites in independent CI jobs so integration tests can be sharded separately later.
  • Apply each end-to-end shard to every package that owns an e2e suite, executing packages sequentially within a runner.
  • Encode Go and CLI build prerequisites for local e2e entrypoints, then isolate Vitest passthrough arguments from those build tasks.
  • Keep Go unit tests package-local and in their dedicated race-and-coverage workflow while the root Vitest fan-out remains uniformly shardable.
  • Right-size the unit job to a 4-vCPU Blacksmith runner without preemptively capping workers.
  • Remove the test:core alias and document explicit unit and integration commands.

Context

The first e2e shard previously ran every non-CLI-harness e2e suite unsharded, making it consistently much slower than the other shards. Propagating the same Vitest shard to each package distributes those suites uniformly.

Turbo currently provides only the test task graph and prerequisite ordering. Test caching remains disabled until its inputs and outputs are designed separately.

@jgoux
jgoux requested a review from a team as a code owner August 25, 2026 12:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d0417ceaa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli/package.json Outdated
jgoux added 2 commits August 25, 2026 14:46
…ocal-tests

# Conflicts:
#	CONTRIBUTING.md
#	nx.json
#	package.json
#	packages/api/package.json
#	packages/cli-test-helpers/package.json
#	packages/config/package.json
#	packages/process-compose/package.json
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@8e97e9c53154bb7b9e405e968b270efb0d1680d0

Preview package for commit 8e97e9c.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d99065a918

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli-go/package.json Outdated
@jgoux

jgoux commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4000d4b12b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@avallete avallete left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — verified the risky spots and they all check out:

  • The 8 @parcel/watcher-* platform packages land in devDependencies only; the published supabase package still ships just eciesjs + jose with files: ["dist/supabase.js"], so no platform-mismatch risk for npm consumers (and this quietly fixes the pnpm build break on missing watcher binaries, including win32 which supportedArchitectures doesn't cover).
  • Forwarding --shard=N/3 to every e2e package is safe: all three e2e-owning vitest configs set passWithNoTests: true (packages/stack only has 4 e2e files).
  • Dropping the keyring-unlock step from test.yml is correct: cli-go-ci.yml keeps the unlock and its merge_group trigger has no path filter, so Go tests still gate every merge even when a PR doesn't touch apps/cli-go/.
  • No test files orphaned by the removed vitest project stanzas (api/config have zero integration/e2e files, process-compose zero e2e), and every package with unit tests declares test:unit:run.
  • test-summary preserves the branch-protection check name and mirrors the existing test-e2e-summary skipped-handling pattern with identical if conditions.
  • No stale test:core / nx affected / NX_BASE references remain.

Two non-blocking comments inline about leftover Nx test-target inference and the dual build orchestrators.

Comment thread CONTRIBUTING.md
| `types:check` | Type-check with `tsc --noEmit` _(inferred by Nx plugin)_ |

The inferred scripts (`test:unit`, `test:integration`, `test:e2e`, `types:check`) are not declared in `package.json` — they are injected by local Nx plugins in `tools/nx-plugins/`. They are fully cached and can be discovered via `nx show project <name>`.
The test scripts are declared in each package's `package.json`, so package-local test commands are directly discoverable and can be sharded independently. Type-checking remains an Nx-inferred target.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking, but this line is ahead of the code: tools/nx-plugins/src/test.plugin.ts is still registered in nx.json and still infers test:unit/test:integration/test:e2e targets from every vitest config with cache: true (and go.plugin.ts still infers test:unit for cli-go; nx.json also keeps the test/test:e2e targetDefaults). So nx run-many -t test:unit remains a second, cached test path that invokes vitest directly and bypasses the Turbo orchestration — a stale-green footgun. Since nothing in CI uses those targets anymore, it'd be worth stripping the test-target inference (keeping types:check and project registration) here or in a fast follow-up.

# every package-local e2e suite.
- name: Build CLI
if: steps.detect.outputs.cli_e2e == 'true'
run: pnpm exec nx run supabase:build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: CI builds the CLI via nx run supabase:build while the local test:e2e scripts build via turbo run supabase#build@supabase/cli-go#build. Both work, and I get that Turbo only owns tests for now, but worth converging on one build orchestrator eventually. Related: the Nx project is named cli-go (go.plugin default) while the new apps/cli-go/package.json names it @supabase/cli-go — two names for the same workspace invites confusion.

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