Share install/build across E2E shards via artifact - #921
Draft
Liam Farrelly (lfarrel6) wants to merge 9 commits into
Draft
Share install/build across E2E shards via artifact#921Liam Farrelly (lfarrel6) wants to merge 9 commits into
Liam Farrelly (lfarrel6) wants to merge 9 commits into
Conversation
Adds a single build job that installs deps, builds all workspace packages, and uploads their dist outputs as one artifact. The e2e-test matrix downloads that artifact instead of rebuilding per shard, and runs on ev-runner-large (8 cores) so each shard gets ~8 Playwright workers via workers: "100%".
|
The previous `pnpm run -r --if-present build` built every package with a
build script, including 3ds, eql, js, and both react-native packages —
none of which are dependencies of any e2e-tests package. Filtering by
`{./e2e-tests/*}...` drops the build set from 11 packages to the 6 that
are actually needed (browser, card-validator, inputs, ui-components,
react, encryption), avoiding the slow rollup/bob/cjs+esm builds.
For projects whose suites are dominated by per-job setup time, sharding
adds more orchestration overhead than it saves in test runtime. The
discovery step now emits a full {project, shard, total-shards} matrix
and treats browser + crypto-harness as single-job runs (--shard=1/1).
Inputs and ui-components remain split into 2 shards.
The setup-node pnpm cache only stores the content-addressable store, not the assembled node_modules tree. With node-linker=hoisted that hardlink phase is the slow part of install, so add a second actions/cache step keyed on the lockfile (plus .npmrc + pnpm-workspace.yaml so layout changes invalidate cleanly). On a cache hit the install step is skipped entirely; on miss it falls back to --prefer-offline. Also align the build job's install with the other jobs (--prefer-offline) and add a couple of pnpm tunings: higher network concurrency for cold installs and skip store integrity re-verification (the CI store is ephemeral so the check buys little).
The path filter previously matched any change under .github/**, so every unrelated workflow edit triggered an iOS + Android build. Narrow it to this workflow's own file.
Adds an optional base-ref input to lint.yml. When provided, the lint steps and unit tests run with pnpm's --filter=...[<since>] selector, so only packages changed since the base (and their dependents) are exercised. Root-level changes (lockfile, .npmrc, workflow files, root package.json) escape the filter and trigger a full run. The PR workflow now passes github.base_ref so PRs only check what they touch. push.yml is unchanged and still runs the full suite on master. Also adds cancel-in-progress concurrency to the react-native workflow so new pushes to a branch supersede in-flight iOS/Android builds.
Replace the boolean UNSHARDED list with a per-project shard-count map so each suite can be sized independently. ui-components moves from 2 to 4 shards; browser and crypto-harness stay at 1 (unsharded); inputs uses the default of 2.
Going from 2 to 4 shards increased wall-clock CI time — the per-shard setup and orchestration overhead exceeded the test-runtime savings. Drop ui-components from the SHARD_COUNTS map so it falls back to the default of 2.
Three patterns dropped while preserving every assertion:
- cardDetails snapshot tests (4 sites): waitForTimeout(2000) replaced
with expect(frame.getByLabel("Number")).toBeVisible() — auto-retries
until the iframe is interactive instead of always paying 2s. Across
5 browser projects per shard this was ~40s of pure idle per run.
- inputs/events (2 sites): waitForTimeout(800) replaced with
expect.poll(() => data?.isValid).toBe(true). The tests already assert
isValid: true so this is the same end-state, just resolved as soon as
the SDK emits it.
- inputs/magswipe (2 sites): waitForTimeout(500) replaced with
expect.poll(() => data?.encryptedCard?.swipe).toBe(true). Magswipe
tests assert isValid: false (cvc missing) but swipe: true, so this is
the right ready signal.
The downstream assertions on data.encryptedCard.* are unchanged.
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
Aiming to reduce CI times.
How
Adds a single build job that installs deps, builds all workspace packages, and uploads their dist outputs as one artifact. The e2e-test matrix downloads that artifact instead of rebuilding per shard, and runs on ev-runner-large (8 cores) so each shard gets ~8 Playwright workers via workers: "100%".