Skip to content

ci: run Playwright in its own image, sharded - #157

Merged
ExtraToast merged 2 commits into
mainfrom
ci/playwright-image
Oct 23, 2026
Merged

ExtraToast merged 2 commits into
mainfrom
ci/playwright-image

Conversation

@ExtraToast

Copy link
Copy Markdown
Contributor

Why

task e2e runs playwright install --with-deps chromium, so every CI run installed the browsers' system packages through apt. In home-portal that apt step hung on a slow Ubuntu mirror until the job's 30-minute limit, and the tests never ran (JorisJonkers-dev/home-portal#95). Same fix as the template's, JorisJonkers-dev/template-go-vue#13.

What

  • No install at run time: the e2e jobs run in mcr.microsoft.com/playwright:v<version>-noble, the image for exactly the @playwright/test version pnpm-lock.yaml resolves, read by the build job so Renovate bumps keep working. HOME=/root for the container's root user; mise installs only node, pnpm and task there.
  • Built once: End-to-end build runs task build and hands the binary to the shards as an artifact. Both jobs keep the app bucket gate.
  • No compose in a container job, so task db becomes:
    • Postgres, Mailpit and Vault (dev mode, same root token) as service containers, reached by name;
    • compose's migrate as a docker:// step from the same pinned liquibase-runner image (ci up 000000000000), and vault-init as one from hashicorp/vault:1.21.4, both on the job's network.
    • The suite reads the addresses from E2E_SMTP_ADDR, E2E_VAULT_ADDR and E2E_MAILPIT_URL, each defaulting to the compose port it used before, so local runs are unchanged. Prefixed so a VAULT_ADDR in someone's shell never reaches the suite.
  • Sharded: desktop and phone × 2 shards, four jobs at once, 15-minute limit, fail-fast: false.
  • One report: CI writes blob reports (local runs keep list); End-to-end report merges them into one HTML artifact and is not part of Pipeline Complete, which now also waits for the build.
  • task e2e:ci is the suite alone, with Playwright options after --.

Checks

  • actionlint, task lint:web, task secrets pass locally.
  • The shard jobs simulated locally: a linux binary; postgres:16-alpine, Mailpit and Vault on a docker network under their service names; the migration and transit-key commands run exactly as the steps run them (workspace as working directory); then task e2e:ci inside mcr.microsoft.com/playwright:v1.64.1-noble: desktop 1/2 and 2/2 11 + 11 passed, phone 22 passed.

`task e2e` ran `playwright install --with-deps` in CI, which runs apt on every run; in
home-portal a slow Ubuntu mirror hung it until the job's 30-minute limit
(JorisJonkers-dev/home-portal#95). The e2e jobs now run in the Playwright image for the version
the lockfile resolves, against one prebuilt binary, two shards per device, merged into one HTML
report. A container job has no compose, so Postgres, Mailpit and Vault are service containers
and the migration and transit keys run as container steps from compose's images; the suite reads
their addresses from E2E_* variables, defaulting to the compose ports. `task e2e:ci` is the
suite alone, so local `task e2e` is unchanged. As JorisJonkers-dev/template-go-vue#13.
@ExtraToast ExtraToast added type: chore Maintenance work without intended behavior change. component: ci Continuous integration workflow or check behavior. labels Oct 23, 2026
@github-actions

Copy link
Copy Markdown

Mutation report

Every mutant on the changed lines was caught by a test.

This report never fails the build.

A cold mise cache installs every linter too, minutes of a job that needs four tools. Through the
shims, not `mise exec`, which would install the rest anyway.
@ExtraToast
ExtraToast merged commit 3c9d4bb into main Oct 23, 2026
22 checks passed
@ExtraToast
ExtraToast deleted the ci/playwright-image branch October 23, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ci Continuous integration workflow or check behavior. type: chore Maintenance work without intended behavior change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant