Skip to content

ci(oracles): check that the e2e gap tests partition into CI shards - #34

Merged
KyleAMathews merged 3 commits into
mainfrom
ci/e2e-shard-partition
Nov 11, 2026
Merged

KyleAMathews merged 3 commits into
mainfrom
ci/e2e-shard-partition

Conversation

@KyleAMathews

Copy link
Copy Markdown
Contributor

This change adds a checked partition of the end-to-end gap oracle's tests into five CI shards. CI does not run the shards yet. The partition waits until the property registers its parts as units. Until then, the check keeps the partition in step with the tests.

Why the shards wait

The end-to-end gap oracle (oracle-gaps/gap-report-oracle.property.test.mjs) registers 13 tests: the fixed-seed campaign, the random campaign, 10 calibrations, and the determinism test. A shard can only hold whole tests. The determinism test runs all 30 named histories twice, about 345 s locally and about 800 s on CI. Any 5-way split therefore has one job of about 14 minutes, past the limit of 10 minutes for CI. So CI keeps its one fixed-seed job for now. When the property registers its campaigns and determinism histories as separate tests, the partition grows to those units and CI runs it as a matrix.

What the partition promises

Every test of the file is in exactly one shard. A test in no shard would leave its law out of CI. A test in two shards would run twice. The check script enforces both rules against what vitest list reports:

node scripts/e2e-shards.mjs check            # in packages/oracles
node scripts/e2e-shards.mjs pattern e2e-3
^oracle-gaps\.report(?: | > )(?:fixed seed 20261105|calibration: a refused run is reported as complete)$

The check fails in three cases:

  • a test is in no shard
  • a test is in several shards
  • a shard names a test that does not exist

The script anchors each shard's -t pattern, so fixed seed 20261105 does not also select a test whose name extends it. The pattern accepts both name joins: Vitest 4 joins a suite and a test with a space, and Vitest 5 joins them with >. The check simulates the Vitest 5 join on the names that vitest list prints. No shard ran under Vitest 5.

The shards balance the costs measured on main at 84cd34a, longest first:

shard tests local cost
e2e-1 determinism about 345 s
e2e-2 random seed 160 to 600 s, by its seed
e2e-3 fixed seed, the refused-run calibration about 259 s
e2e-4 the two daemon calibrations, two corrupt calibrations about 197 s
e2e-5 five corrupt calibrations about 220 s

Where it runs

The Test job runs pnpm --filter @tanstack/oracles run test:oracle-gaps:shards, which takes about 3 s. It checks the partition ahead of the shard jobs, which CI does not run yet. The script lives in packages/oracles/scripts/, which the package does not publish.

Verification

  • The check passes on this branch.
  • The check reported each of four wrong partitions. These were a misspelled test name, a test in two shards, and a new test in no shard. The fourth was a test whose name extends a shard's test name.
  • The Test job's steps pass locally in 54 s. They are build, lint, format, typecheck, the unit tests, the shard check, publint, and sherif.
  • npm pack --dry-run lists no file under scripts/.

This pull request and its description were written by Isaac.

KyleAMathews and others added 3 commits November 11, 2026 11:41
… shards

scripts/e2e-shards.mjs names five shards of the e2e oracle's tests,
balanced by the costs measured on main. Its check lists the file's tests
with vitest list and fails when a test is in no shard or in several, or
when a shard names no test. Its pattern command prints a shard's -t
pattern, which selects the test under Vitest 4's and Vitest 5's name
joins. The Test job runs the check (3 s). CI keeps its one fixed-seed e2e
job: until the property registers its parts as units, the determinism
test alone would be a shard of about 14 minutes.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c87edd1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dbf863e4-8a35-443b-840e-84bb1e584f4c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/TanStack/oracles/@tanstack/eslint-plugin-oracles@34
npm i https://pkg.pr.new/TanStack/oracles/@tanstack/oracles@34

commit: c87edd1

@KyleAMathews
KyleAMathews merged commit a19c01f into main Nov 11, 2026
13 checks passed
@KyleAMathews
KyleAMathews deleted the ci/e2e-shard-partition branch November 11, 2026 22:25
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