Skip to content

Run Playwright's test runner on Bun - #81

Merged
firsttris merged 1 commit into
masterfrom
bun-playwright
Nov 3, 2026
Merged

firsttris merged 1 commit into
masterfrom
bun-playwright

Conversation

@firsttris

Copy link
Copy Markdown
Owner

Runs Playwright's test runner on Bun (bun --bun playwright test) instead of Node, as firsttris/haben does and as the tech stack asks. With this, nothing in the repository needs Node any more.

  • e2e/package.json: test and screenshots run bun --bun playwright test
  • e2e/scripts/image-test.sh: bun --bun playwright test instead of bunx playwright test
  • ci.yml (e2e jobs for local, image and binary): bun --bun playwright install --with-deps chromium; the comment no longer says the runner runs on Node
  • screenshots.yml needed no change: it runs bun run screenshots, and Bun still comes from npm install --global "bun@…" in the Playwright image
  • docs/development.md, README.md, Renovate's Bun note: Node is no longer listed as a requirement for the end-to-end tests

Tests

Run locally with Node removed from PATH, compared with the runner on Node (same checkout, same Chromium):

Target Bun Node
local 32 passed, 2 skipped 31 passed, 2 skipped, 1 failed (schedules.spec.ts "a disk that is not mounted…", passed twice on a rerun under Node: flaky)
binary 32 passed, 1 skipped, 1 failed 32 passed, 1 skipped, 1 failed
image not run: no Docker daemon in this environment not run

Skipped: docker.spec.ts (no Docker daemon) and, on the local target, binary.spec.ts. The failure on the binary target is the same under both runners and does not come from this change: changes.spec.ts "deleted and encrypted files are restored…" finds two "Restore" finished successfully toasts (the first restore's is still visible when the second finishes) and trips strict mode. The screenshot config lists its 14 tests under Bun and bun run typecheck passes; the screenshots themselves were not taken here.


Generated by Claude Code

The end-to-end tests and the screenshots now start the runner with
`bun --bun playwright test`, as firsttris/haben does and as the tech stack
asks; Node is no longer needed to develop or test SnapRAID UI. CI installs
the browser with `bun --bun playwright install`, test:image runs the runner
the same way, and the docs, the README and Renovate's Bun note drop Node.

Checked with Node removed from PATH: the local and the binary targets pass
the same tests as with the runner on Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z

Copy link
Copy Markdown
Owner Author

TDD review: no proven findings

Reviewed the diff (e2e/package.json, e2e/scripts/image-test.sh, ci.yml, screenshots.yml path, docs, README, renovate) and checked every suspicion with a run. Local runs used Bun 1.4.4 with no node on PATH, Node 22 for comparison. None of them failed, so there are no findings.

Checked and not proven:

  • Test count: bun run test --list gives 34 tests in 16 files, the same as Node. --shard=1/2 gives 18/7 and --shard=2/2 gives 16/9 on both. bun run screenshots --list gives 14 on both. E2E_IMAGE=x scripts/image-test.sh --list gives 34.
  • Argument passing: bun run test --shard=… --grep … reaches Playwright, and image-test.sh "$@" passes arguments through too.
  • Exit codes: a passing run exits 0. A failing test exits 1, both through bun run test and through image-test.sh. Ctrl-C (SIGINT) exits 130. An empty shard exits 0, the same as Node.
  • Runner and workers really on Bun: globalThis.Bun is defined in the worker. CI reaches the tests. forbidOnly rejects test.only under CI=1.
  • Global setup/teardown: a teardown returned from the global setup runs after passing and failing runs and after SIGINT, and leaves no stray child process. One real harness run (CI=1 bun run test --shard=1/2 --grep self-test, which builds the frontend and starts snapraidd and the backend) passed with 1 test, and no servers were left running.
  • CI artifacts: under CI=1 the HTML reporter, trace.zip, the failure screenshot and error-context.md are written. bun --bun playwright show-trace serves the trace (200).
  • bun --bun playwright install without setup-node: cdn.playwright.dev can't be reached from here. Instead I served the headless shell from a local stand-in (PLAYWRIGHT_DOWNLOAD_HOST). Under Bun, download, extraction and permission fixing behave exactly as under Node, including the forked download process. install --dry-run --with-deps works under Bun. The real apt-get step of --with-deps on the ubuntu-26.04 runner could not be checked here; CI shows whether it works.

Known issues (changes.spec "deleted and encrypted files…" on the binary target, the flaky scheduled-sync test) were not counted, as agreed.

Note: master has moved on by one commit (lock file maintenance, #79), which merges cleanly. Since there are no fix commits, I did not rebase or push.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

TDD-Review abgeschlossen: keine belegten Findings (Details im vorigen Kommentar). CI grün: backend, frontend, install, e2e local 1–2/2, e2e binary 1–2/2, e2e image 1–2/2 – damit läuft der Playwright-Runner auch im CI-Runner und im Image auf Bun.

Merge per Squash.


Generated by Claude Code

@firsttris
firsttris merged commit 06a57f4 into master Nov 3, 2026
9 checks passed
@firsttris
firsttris deleted the bun-playwright branch November 3, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants