Run e2e job inside the Playwright container image#282
Run e2e job inside the Playwright container image#282mariusvniekerk wants to merge 10 commits intogotestsumfrom
Conversation
Switch the e2e matrix job to `runs-on: ubuntu-latest` with `container: mcr.microsoft.com/playwright:v1.55.1-noble`. Browsers and their OS deps ship preinstalled in that image, so we drop the `bunx playwright install --with-deps` step entirely. The motivation is the apt-get phase of `--with-deps`. Recent webkit runs spent ~13 of the ~14-minute install step pulling 114 MB of gstreamer/gtk debs from azure.archive.ubuntu.com at ~143 kB/s. The browser tarball download itself is the cheap part, so caching `~/.cache/ms-playwright` would not have helped; eliminating the apt round-trip does. Tag pin (`v1.55.1-noble`) must track `@playwright/test` in bun.lock. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
The Playwright image (mcr.microsoft.com/playwright:v1.55.1-noble) is minimal beyond Node.js and the browsers; it ships without unzip, which oven-sh/setup-bun shells out to in order to extract the bun tarball. The action fails on every matrix entry with: Error: Unable to locate executable file: unzip. Add a tiny apt-get step before setup-bun. The metadata fetch and single package install are cheap (~a few seconds), unrelated to the heavy gstreamer install that motivated moving to the container image. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
actions/checkout writes its safe.directory entry against a temporary HOME during its own steps, so when later steps run inside the container with HOME=/github/home, the entry is gone. go build then fails the VCS-stamp shell-out with "error obtaining VCS status: exit status 128", since git refuses to read a working tree owned by another uid (the host runner). Re-register safe.directory after checkout against the persistent HOME so subsequent git invocations from go build succeed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
The host-runner Go jobs (lint, test, race, build) all share an ~178 MB setup-go cache keyed setup-go-Linux-x64-ubuntu24-go-1.26.0-<go.sum-hash> The "ubuntu24" segment comes from setup-go reading the ImageOS env var, which GitHub sets on hosted runners but does not propagate into container jobs. The e2e job therefore got a cache miss every run and re-downloaded the entire module set inside the container. The Playwright image is also Ubuntu 24 (noble) on amd64 with the same Go toolchain, and the build/module caches are content-addressed (filenames are hashes of inputs, no absolute paths baked in), so the host's cache is reusable from inside the container. Set ImageOS at the job level so the keys line up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
The Playwright image doesn't ship tmux, but the e2e workspace runtime spawns tmux sessions to host workspace shells. Without it the e2e tests fail with "tmux: executable file not found" before they can drive the UI. Bundle the install with unzip so we still hit apt-get only once.
roborev: Combined Review (
|
Firefox and WebKit refuse to launch when \$HOME is owned by another user. Actions runs the Playwright container as root but sets HOME=/github/home, which the image initializes as pwuser, so Playwright dies with "Firefox is unable to launch if the \$HOME folder isn't owned by the current user". Setting HOME=/root just on the test step is the workaround Playwright's own error message recommends, and leaves the surrounding steps (setup-go cache, bun install) on /github/home where they expect to be.
roborev: Combined Review (
|
When a workflow run is cancelled mid-test (e.g. concurrency cancel from a follow-up push), gotestsum's --jsonfile is left without a final elapsed-bearing event. The publish steps still ran under 'if: always() && ...' and dorny/test-reporter then errored with "missing elapsed on final test event", clobbering the run with a red annotation that has nothing to do with the actual test results. Switch the conditions to !cancelled() so we only publish when there's a real, complete result file to parse; success and failure paths still publish as before.
roborev: Combined Review (
|
Two related bugs in gitclone.Manager.Diff that only show up on git
< 2.50 (e.g. the Playwright noble image used by the e2e job runs git
2.43, while hosted ubuntu-latest is on 2.53):
- whitespaceOnlyFiles compared "git diff --raw" to "git diff --raw -w"
and treated the difference as the whitespace-only set. Older git
ignores -w in --raw output (it just compares blob SHAs), so the two
outputs were identical and we concluded no file was whitespace-only.
Pivot through --numstat -w instead, which honors -w consistently.
- The hideWhitespace=true branch never dropped files from the result;
it relied on --raw -w doing the filtering for us. Older git leaves
those files in, so the API returned modified-but-whitespace-only
files even when the caller asked to hide them. Drop them server-side
after parsing, gated on Status == "modified" so renames/adds/deletes
still pass through.
Caught by tests/e2e-full/diff-view.spec.ts "hide whitespace toggle
filters whitespace-only files", which expected 3 files but saw 4 in
the noble container.
roborev: Combined Review (
|
setup-go's cache tarball stores absolute paths from where it was saved. Host jobs save with GOCACHE=/home/runner/.cache/go-build, but the e2e container resolves go env to /github/home/.cache/go-build, so even when the cache key matches (after the earlier ImageOS=ubuntu24 fix), the restore extracts to /home/runner/... and Go looks at /github/home/... and finds nothing. Result: every e2e browser builds the e2e-server binary cold, ~30 s. Pin GOCACHE and GOMODCACHE to the host paths in the container, mkdir them before setup-go runs so the restore has a target, and the e2e-server build now hits the warm cache populated by the test/race host jobs.
roborev: Combined Review (
|
@actions/cache hashes the compression method into the cache version alongside the paths and key. Host runners ship zstd and save with cache.tzst; the Playwright noble image lacks zstd and falls back to gzip, so the container looks up cache.tgz under the same setup-go-* key and misses every time. Path alignment alone (the prior fix) wasn't enough — same key, different version. Add zstd to the apt-get install so @actions/cache picks it up and the container-side lookup matches the host's saved version. The Build E2E server step should now hit the warm cache on subsequent runs instead of compiling cold.
roborev: Combined Review (
|
Summary
e2ematrix insidemcr.microsoft.com/playwright:v1.55.1-noble. Browsers + OS deps are preinstalled, so thebunx playwright install --with-depsstep is dropped.v1.55.1-nobleis pinned to match@playwright/testinbun.lock; bumps to playwright must bump the tag in lockstep.mainonce Run Go tests through gotestsum with dorny/test-reporter #280 merges.Why
Recent webkit run #74867926876, step 8 spent ~13 of ~14 minutes in
apt-getpulling 114 MB of gstreamer/gtk debs fromazure.archive.ubuntu.comat ~143 kB/s. Caching~/.cache/ms-playwrightwould not have helped — the apt traffic is the bottleneck. Using the prebuilt image eliminates that round-trip.🤖 Generated with Claude Code