Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/playwright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ jobs:
- name: Setup network
run: docker network create frontend

- name: Pull container images
# Pull all images this job uses up front, in parallel (compose pulls
# services concurrently). Otherwise each image is pulled on demand inside
# the first step that uses it — serially across steps (~90s total:
# mariadb+phpfpm in Composer install, node in Build assets,
# nginx+playwright in Run playwright). Pulling concurrently overlaps the
# smaller images under the large playwright pull.
run: docker compose pull --quiet phpfpm node playwright nginx mariadb

- name: Composer install
run: |
docker compose run --rm phpfpm composer install
Expand All @@ -56,11 +65,18 @@ jobs:
docker compose run --rm node npm run build

- name: Run playwright
env:
CI: "true"
# `-e CI=true` propagates CI *into* the container — `docker compose run`
# does not forward host env by default, so without it playwright.config.ts
# sees no CI and falls back to its defaults (50% of cores ≈ 2 workers,
# retries 0). The explicit flag is what actually enables workers: 3 and
# retries: 2 on the runner.
#
# The mcr.microsoft.com/playwright image already bundles the browsers for
# its version, kept in lockstep with @playwright/test in package.json, so
# `playwright install --with-deps` only re-runs apt for libraries that are
# already present. Run the tests directly.
run: |
docker compose run --rm playwright npx playwright install --with-deps
docker compose run --rm playwright npx playwright test
docker compose run --rm -e CI=true playwright npx playwright test

- uses: actions/upload-artifact@v7
if: always()
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- Sped up the Playwright CI job: it now runs in parallel (3 workers, sized to the 4-vCPU public
GitHub runner) instead of the default 2, added `ipc: host` to the `playwright` Compose
service so parallel Chromium does not exhaust Docker's default 64 MB `/dev/shm`, pulls the
container images once up front in parallel instead of on demand serially across steps
(~90s of pulls overlapped), and dropped the redundant `playwright install --with-deps` step
(the pinned Playwright image already ships the matching browsers).
- Removed a dead statement in `MediaRepository::getPaginator()` that referenced the undefined
variables `$page` and `$itemsPerPage`; the computed value was never used.
- Fixed inverted user-type guard in `UserService::activateExternalUser()`: the "user is not of
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ services:
# https://playwright.dev/docs/docker
# Version should match the one in `package.json`.
image: mcr.microsoft.com/playwright:v1.57.0
# Chromium needs more than Docker's default 64 MB /dev/shm once tests run in
# parallel; sharing the host IPC namespace avoids renderer crashes
# ("Target closed"). See the Playwright Docker docs.
ipc: host
networks:
- app
depends_on:
Expand Down
7 changes: 5 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* CI runs on a 4-vCPU GitHub-hosted runner (public repo); use 3 workers and
* leave one core for the browser/system. Tests mock every network call per
* page (see assets/tests/**\/test-helper.js), so they are isolated and safe
* to run in parallel. Locally, Playwright's default (50% of cores) applies. */
workers: process.env.CI ? 3 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
// Open never added to avoid the CI pipeline to get stuck in a html-reporter-mode.
reporter: [['html', { open: 'never' }]],
Expand Down
Loading