GuidesSpeed up your suite
Replace Playwright sharding
Replace a matrix of Playwright --shard jobs and a merge-reports job in GitHub Actions with one Endform run that schedules every test and merges the reports.
Endform schedules your tests across isolated remote runners and merges reports for you, so you do not need Playwright sharding at all. Instead of maintaining a matrix of CI jobs, downloading browser binaries on every runner, uploading blob artifacts, and running a downstream merge-reports job, one lightweight CI job runs npx endform@latest test.
Why Endform does away with Playwright sharding
Playwright's --shard=i/N flag splits a suite across multiple CI jobs so you can throw more CI runners at a slow suite. That works up to a point, then breaks down in four predictable ways:
- Every shard repeats the same setup tax. Each CI job boots a fresh runner, checks out your repository, runs
npm ci, and downloads or restores 300 to 500 MB of browser binaries and OS libraries before the first test starts. - Static file-order splits create straggler shards.
--shard=i/Ndivides files statically without knowing how long each file takes. One heavy spec file holds up the entire matrix, and your shard count goes stale every time the suite grows. - Report merging lives in your CI YAML. Every shard has to switch to
reporter: "blob", upload itsblob-report/directory as a CI artifact, and trigger a finalmerge-reportsjob just to produce one HTML or JUnit report. - Speed only works in CI. Sharding is wired into your CI matrix, so engineers and coding agents running tests from a laptop still wait on local workers.


With Endform:
- One lightweight CI job runs
npx endform@latest testwith no browser downloads, no runner matrix, and no shard count to retune. - Endform schedules tests across isolated remote machines automatically so slow files do not strand idle shards.
- Endform collects and merges reports automatically, running Playwright's
merge-reportsunder the hood so your normalhtml,github,junit, or custom reporters work unchanged. - Same command locally and in CI. Engineers and coding agents run the exact same
npx endform@latest testcommand from a laptop and get the same speed.
Migrate from a sharded GitHub Actions workflow
-
Set up CI authentication
Choose either the Endform GitHub App (OIDC, no secret to manage) or an
ENDFORM_API_KEYsecret:Connect the Endform GitHub App to your repository so workflows authenticate via GitHub OIDC (
id-token: write) with no API key secret to rotate. The GitHub App is also required if you run tests against Vercel previews.npx endform@latest connect githubIf your organization already has the Endform GitHub App installed, verify in GitHub installation settings that this repository is included. See GitHub App and CI authentication for details.
If you cannot install GitHub Apps on the repository, create an API key interactively (so you can pick the right organization if you belong to more than one) and store the printed key as an
ENDFORM_API_KEYsecret in GitHub Actions:npx endform@latest api-key create --name "GitHub Actions"Then add it to GitHub Actions via
gh secret set ENDFORM_API_KEYor repository settings. See CI authentication for details. -
Collapse your sharded workflow into one Endform job
Remove
strategy.matrix.shard, the browser install and cache steps,blob-reportartifact uploads, and the downstreammerge-reportsjob. Replace them with a single job runningnpx endform@latest test:.github/workflows/playwright.yml name: Playwright Tests on: [push, pull_request] permissions: contents: read id-token: write jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npx endform@latest test env: BASE_URL: ${{ vars.STAGING_URL }}.github/workflows/playwright.yml name: Playwright Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npx endform@latest test env: ENDFORM_API_KEY: ${{ secrets.ENDFORM_API_KEY }} BASE_URL: ${{ vars.STAGING_URL }}.github/workflows/playwright.yml name: Playwright Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: shard: [1, 2, 3, 4] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npx playwright install --with-deps chromium - run: npx playwright test --shard=${{ matrix.shard }}/4 env: BASE_URL: ${{ vars.STAGING_URL }} - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: blob-report-${{ matrix.shard }} path: blob-report retention-days: 1 merge-reports: if: ${{ !cancelled() }} needs: [test] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - uses: actions/download-artifact@v4 with: path: all-blob-reports pattern: blob-report-* merge-multiple: true - run: npx playwright merge-reports --reporter html ./all-blob-reports - uses: actions/upload-artifact@v4 with: name: html-report path: playwright-reportWhen using the GitHub App, keep
contents: readalongsideid-token: write, since specifyingpermissionsin GitHub Actions drops any permissions you do not list. -
Clean up
playwright.config.tsRemove any CI-only
reporter: process.env.CI ? "blob" : "html"conditional and configure the reporters you actually want directly:playwright.config.ts export default defineConfig({ reporter: [["html"], ["github"]], });Endform merges runner reports automatically and hands the combined result to every configured Playwright reporter (see Custom reporters). If you also want a downloadable
playwright-reportartifact in GitHub Actions in addition to the Endform dashboard, keepactions/upload-artifact@v4after the test step. Leaveworkers: process.env.CI ? 1 : undefinedalone if you still use it for local runs; it does not throttle Endform cloud runs. If a single spec file packs several long tests, see Fully parallel testing for enablingfullyParallel: true. -
Check
globalSetup, runner files, and an in-CIwebServer, then remove the old jobsglobalSetupand setup projects: Under sharding,globalSetupran once per shard. On Endform it runs once per suite run on the CI runner itself, and anystorageStatefiles it writes are transferred to the remote runners automatically. If yourglobalSetuplaunches a browser directly (rather than using a Playwright setup project), keepnpx playwright install --with-deps chromiumin the CI job. Also check What is sent to runners if tests read non-imported files from disk.- An app
webServerstarted inside CI: Under sharding, each CI runner started its own copy of your app to serve1/Nof the tests. With one Endform job, that single CI runner serves the whole suite over Endform's built-in tunnel. Make surewebServerruns a production build (npm run build && npm run start) and add awithin-suite-runlimit inendform.config.tsif needed, or point CI at a deployed preview URL for full parallelism. See Test against a local server and Optimize test load.
If you want a zero-risk cutover on a large repository, run the new single-job Endform workflow alongside your existing sharded workflow on one pull request, confirm the test count, reporter outputs, and wall-clock time match or beat the matrix, then delete the old sharded jobs.
In BikeBook, a single lightweight GitHub Actions job runs all 103 tests in suites/03-scaled-suite across isolated Endform runners in about 30 seconds:
Scaled BikeBook suite (103 tests)
103 tests backed by API-created users and office fleets, running concurrently across isolated machines in about 30 seconds.
Migration notes
# Before: orchestrator wrapper across multiple CI runners
- run: npx pwc-p --record --key ${{ secrets.CURRENTS_RECORD_KEY }}
# After: one CI job, no orchestrator config
- run: npx endform@latest testRemove the orchestrator CLI package and config file (such as currents.config.ts), collapse your CI matrix to a single job using either the GitHub App (id-token: write) or ENDFORM_API_KEY, and keep your existing playwright.config.ts intact.
e2e:
image: node:22
script:
- npm ci
- npx endform@latest testThe same collapse applies on every CI provider: remove parallel: (GitLab CI) or parallelism: (CircleCI), drop --shard, delete the browser-install step and blob artifact passing, and remove the downstream merge-reports stage. Non-GitHub CI providers authenticate with ENDFORM_API_KEY.
npx endform@latest test --shard=1/2Yes. The Endform CLI forwards Playwright's --shard=i/N flag if you deliberately want to run a subset of your suite, though you almost never need it once Endform schedules tests across isolated remote runners for you.
Remove shared-state blockers and shrink slow outlier tests that set wall-clock time.
Optimize test loadBalance speed and reliability when parallel fan-out hits staging or third-party limits.
Set up Endform in CIConfigure CI authentication, pull request comments, and the Endform GitHub App.
Last updated