Repository navigation
⚡️(ci) speed up the e2e job - #386
Merged
Merged
Conversation
Playwright compiles the components from src with Vite, so the e2e job doesn't need the ui-components dist. Building it took about 40 s of each run. The tests still need the ui-tokens build, which the theme imports.
On CI, Playwright uses half the CPUs by default: 2 workers on the 4 vCPU GitHub runners, so the 1,000+ tests took 9 minutes. They mostly wait on the browsers, so one worker per vCPU should run them much faster on the same runner, without waiting for more runners from the shared pool.
The three browsers ran one after the other on the same runner. A job per browser runs them at the same time. We stop at three jobs: the runners come from a pool shared by the whole organization, and every extra job may wait for a free runner and repeat the setup. The job name also tells which browser failed, and a rerun only runs that browser again.
NathanVss
force-pushed
the
ci/speed-up-e2e
branch
from
November 17, 2026 11:02
1ea5103 to
ce9601a
Compare
The canvas of the scanned page stays hidden until pdfjs has decoded its three JPEG 2000 layers. With 4 workers sharing the CI runner, that takes more than the 10 s the test gave it, so it failed every time in Chromium. The rest of the test already allowed for the slow decode.
NathanVss
marked this pull request as ready for review
November 19, 2026 10:21
jbpenrath
reviewed
Nov 19, 2026
jbpenrath
left a comment
Contributor
There was a problem hiding this comment.
By reviewing this PR, I think about another ci checks that could be useful. Surely to do in a dedicated PR.
build:
# ...
- name: Build
run: yarn build
- name: Upload generated tokens
uses: actions/upload-artifact@v4
with:
name: generated-tokens
path: |
packages/ui-components/src/cunningham-tokens*
packages/ui-tokens/src/lib/cunningham-tokens.ts
check-tokens:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download generated tokens
uses: actions/download-artifact@v4
with:
name: generated-tokens
path: packages
- name: Check committed tokens are up to date
run: |
git diff --exit-code -- packages \
|| { echo "::error::Cunningham tokens are out of date, run 'yarn build' and commit them."; exit 1; }
jbpenrath
approved these changes
Nov 19, 2026
With 4 workers, the runner's CPU is busy, and a test that waits on a slow render may now and then run out of time, like the scanned PDF did. One retry keeps such a test from failing the whole job, while the report still lists it as flaky so we can see it and fix its timing.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The e2e job took about 10 minutes, 9 of them running the 1,000+ component tests on only 2 workers, one browser after the other.
What
srcitself; only the ui-tokens build is still needed. Saves about 30 s.--that passes--projectto Playwright.Results (measured on this PR)
mainbeforeThe whole workflow now takes about 4 min 40 s. Firefox is the slowest browser and sets the total; splitting it in 2 shards would gain about 1.5 min more, at the cost of a fourth job that may queue.
The check names change from
e2etoe2e (chromium),e2e (firefox)ande2e (webkit). They aren't required checks (onlytestandbuildare), so nothing needs to change in the rules. On failure, each browser uploads its own report (playwright-report-<browser>).🤖 Generated with Claude Code