👷 Add pinned Firefox 119 + WebKit 17.4 e2e + Chromium 120 test runner without BrowserStack#4560
👷 Add pinned Firefox 119 + WebKit 17.4 e2e + Chromium 120 test runner without BrowserStack#4560thomas-lebeau wants to merge 22 commits intov7from
Conversation
|
✨ Fix all issues with BitsAI or with Cursor
|
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
3eb95df to
2a09222
Compare
…rStack - Add `playwright.pinned.config.ts` that boots a Playwright 1.40.1 `run-server` (which bundles FF 119 / WK 17.4) plus a translation proxy, and connects the current 1.58 client over wsEndpoint. - Add `scripts/pinned-proxy.mjs` to bridge the JSON-RPC schema gap between Playwright 1.58 and 1.40 (UA spoofing for the version check, patches to __create__ initializers and a few command params). - Add `test:e2e:pinned:init` / `test:e2e:pinned` scripts to install the pinned browsers locally and run the pinned matrix. - Ignore the local `test/e2e/.pinned-browsers/` install directory.
In WebKit, `beforeunload` doesn't always fire when navigating to a different domain. Specifically, navigating from `localhost` to `foo.localhost` or between `localhost` and `127.0.0.1` silently skips the event, so the SDK never flushes. Tests using `withHostName()` were affected. Fix by navigating to `/flush` on the same origin when the current page is served by the base server, and falling back to the base server origin otherwise.
Firefox does not allow setting cookies from iframes without src, so the SDK won't start and these tests are not meaningful there.
b0eef36 to
df42b80
Compare
- rename test/e2e/scripts/pinned-proxy.mjs to pinnedProxy.ts - add ws and @types/ws to root devDependencies (was an unlisted import) - add types for JSON-RPC messages, RawData handling, and header forwarding - update playwright.pinned.config.ts to invoke `node pinnedProxy.ts`
df42b80 to
6918c2e
Compare
Without this directive, GitLab relies on the project-level "Auto-cancel redundant pipelines" setting, which is currently not effective for this project. Explicitly enabling `auto_cancel.on_new_commit: interruptible` ensures interruptible jobs (e.g. unit-bs, e2e-bs queued behind the browserstack resource group) are cancelled when a new commit lands on the same branch.
The previous check allowed a margin of 2 for Firefox, but Firefox async stack traces can exceed that margin. Instead of continuously adjusting the margin, we drop the upper bound assertion entirely.
|
|
||
| expect((await findSessionCookie(browserContext))?.aid).toEqual(anonymousId) | ||
|
|
||
| expect(true).toBeTruthy() |
c857101 to
6767271
Compare
In WebKit, the dd_cookie_test_* probe cookie (written by areCookiesAuthorized) lingers in the browser's in-memory store after deletion, appearing before the real _dd_s_v2 session cookie. Tests reading cookies[0] or asserting the full cookie array shape would fail because they hit the probe cookie instead.
6767271 to
044b204
Compare
Co-authored-by: Benoit Zugmeyer <benoit.zugmeyer@datadoghq.com>
Firefox renders the inner setTimeout callback as `window.RUM_INIT/<` instead of `<anonymous>` with the npm setup, because the test's rumInit is wrapped in a `window.RUM_INIT` arrow.
8f31454 to
c1f8226
Compare
- install Chromium via the pinned Playwright 1.40.1 in Dockerfile and test:e2e:init - add chromium-pinned project (Chrome 120) to playwright config
f2665a4 to
37289e1
Compare
Two RUM tests (rum/actions: "associate a long tasks to its action", microfrontend: "LOAf should have service and version from source code context") rely on PerformanceLongAnimationFrameTiming, which shipped in Chrome 123 and is not available in chromium-pinned (Chrome 120). Replace the previous "browserName !== 'chromium'" gate with a runtime feature check via PerformanceObserver.supportedEntryTypes — also covers non-Chromium browsers without an explicit version assumption.
…vert after)" This reverts commit f942810.
The Playwright 1.40 server used by the pinned Chromium runtime never emits service-worker-sourced console events on any channel, so the NO_SESSION_WARNING check would always fail there. Detect the pinned runtime via project metadata (presence of `version`) and skip the assertion, mirroring the existing Firefox carve-out. - add `isPinnedRuntime` helper based on project metadata - make `os`/`osVersion` optional in BrowserConfiguration (pinned projects don't set them) and apply `satisfies BrowserConfiguration` to project metadata for type safety
- A bare `yarn test:e2e` now runs only the four non-pinned projects, so a fresh checkout that hasn't run `yarn test:e2e:init` doesn't fail trying to launch pinned browsers it doesn't have. - Pinned projects (and their `run-server` + proxy web servers) only surface when `--project=...` is passed; CI already does this. - Tighten the SW-console comment in the no-session warning assertion.
Earlier on this branch yarn.lock drifted with many unintended downgrades (esbuild 0.27.7→0.27.3, @babel/helpers 7.29.2→7.28.6, @emnapi/* 1.10.0→1.9.2, @1natsu/wait-element 4.2.0→4.1.2, and others) — none of which match a package.json change in this PR. Restore yarn.lock from origin/v7 and rerun yarn install so the lockfile reflects only the real additions on this branch (ws, @types/ws). Net diff vs v7 is now +18/-16.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d34c6ba0ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| RUN npx -y playwright@${PLAYWRIGHT_VERSION} install --with-deps chromium | ||
|
|
||
| # Pinned Playwright browsers: Chromium 120 + Firefox 119 + WebKit 17.4 (used by the e2e-pinned job) | ||
| ARG PINNED_PLAYWRIGHT_VERSION=1.40.1 | ||
| RUN npx -y playwright@${PINNED_PLAYWRIGHT_VERSION} install --with-deps chromium firefox webkit |
There was a problem hiding this comment.
Replace npx with Yarn in Docker build
The root AGENTS.md package-manager rule says this repository uses Yarn workspaces and to never use npm or npx; these new Docker build steps invoke npx twice, so rebuilding the CI image now bypasses the repo's required package-manager workflow and can fail policy/reproducibility checks. Use the Yarn equivalent for invoking the pinned Playwright packages instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
yes! but this is fine for now. we'll find an alternative in a separate PR
…config Filtering projects via process.argv broke worker processes: Error: Project "chromium-pinned" not found in the worker process. Make sure project name does not change. Worker processes don't inherit the test runner's argv, so getSelectedProjects() returned [] inside the worker, getProjects() stripped the pinned entries, and the worker couldn't find the project name assigned to it. ~700 retries later the job died. Project list must be deterministic across processes. Restore the original shape: always return all 7 projects; only the webServer boot decision (which runs only in the main process) gates on argv. The 'fresh-checkout boots pinned servers' UX concern from the review is best handled in docs, not config.
Motivation
Replicate the BrowserStack Firefox 119 + WebKit 17.4 coverage locally so we can keep running pinned-browser e2e tests without BrowserStack, and lay the groundwork for a CI eval loop that iterates on GitLab jobs autonomously.
Changes
e2e-pinnedGitLab job andtest:e2e:pinnedscript driven by a newplaywright.pinned.config.ts.run-serverplus a small translation proxy (test/e2e/scripts/pinned-proxy.mjs) so the current 1.58 client can talk to the older server.CURRENT_CI_IMAGEto 106.flushEventsso the flush works for pages served from custom domains (WebKit fix).iframe-without-srcsession cookie tests on Firefox.APPROACH.md.Test instructions
yarn test:e2e:pinned:initthenyarn test:e2e:pinnedlocally to run Firefox 119 + WebKit 17.4.e2e-pinnedjob runs green in GitLab on this branch.Checklist