Run Builder E2E in nine measured shards

This commit is contained in:
Oleg Isonen committed 2026-11-16 02:11:40 +00:00
1 parent 668bbc2ec7
commit 9c75f6388d
31 files changed
+19 -14

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ runs:
shards=$(pnpm --dir apps/builder exec tsx ./e2e/print-shards.ts)
SHARDS="$shards" node -e '
const shards = JSON.parse(process.env.SHARDS);
if (shards.length !== 10 || shards.some(({ shard, partition }, index) =>
if (shards.length !== 9 || shards.some(({ shard, partition }, index) =>
shard !== `shard-${index + 1}` || partition !== "")) {
throw new Error("Builder E2E shard matrix changed; update the workflow matrix before running CI.");
}
+10 -2
View File
@@ -63,12 +63,20 @@ runs:
env:
GH_TOKEN: ${{ github.token }}
run: |
for attempt in {1..84}; do
wait_started_at=$SECONDS
deadline=$((wait_started_at + 7 * 60))
while (( SECONDS < deadline )); do
available=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts?name=builder-e2e-build" --jq '.artifacts | max_by(.id) | .expired == false')
if [ "$available" = true ]; then
exit 0
fi
sleep 5
# Check more often during normal builds without increasing the
# maximum number of requests if the build never uploads.
if (( SECONDS - wait_started_at < 40 )); then
sleep 2
else
sleep 6
fi
done
echo "Builder E2E build artifact was not uploaded within 7 minutes" >&2
exit 1
-1
View File
@@ -215,7 +215,6 @@ jobs:
- shard-7
- shard-8
- shard-9
- shard-10
permissions:
contents: read
+8 -10
View File
@@ -17,7 +17,7 @@ used by Preview tests.
In CI, the build job caches those compiled files. A later E2E-only change can
restore them after dependency setup; changes outside `apps/builder/e2e` still
compile Builder before the ten shards download the build artifact.
compile Builder before the nine shards download the build artifact.
The schema snapshot is generated from the regular migration pipeline and
committed at `e2e/schema/schema-<fingerprint>.sql`. When a migration or backend
@@ -95,19 +95,17 @@ each invocation.
- Keep tests in a file independent even though Playwright runs them in
declaration order by default.
CI discovers isolated Playwright shards from filename tags. Each shard uses
three workers, except shard 5 uses two to avoid overlapping MCP browser launches.
Files are assigned by measured CI duration to keep the slowest job short:
CI runs nine isolated Playwright shards with three workers each. Files are
assigned by measured CI duration to keep the slowest job short:
```txt
pages-actions.[shard-3].e2e.ts
pages-actions.[shard-9].e2e.ts
```
Every E2E filename must contain at least one unique shard tag. CI derives its
matrix from those tags, so adding or removing a shard does not require editing
the workflow. Files with multiple tags are partitioned across those shards. All
files selected by a shard must use the same set of tags. Rebalance by changing
filename tags when measured job durations drift.
Every E2E filename in CI must contain one shard tag. The build job checks that
the tags match the nine shards in the workflow. Rebalance by changing filename
tags when measured job durations drift.
Suites may opt into parallel mode only when every worker creates uniquely named
setup data and the tests do not depend on each other's mutations.