feat: Add Playwright integration test #51

Merged
martin merged 2 commits from tests/playwright into main 2026-09-11 19:17:51 +00:00
Owner
No description provided.
martin self-assigned this 2026-09-11 17:38:33 +00:00
feat: Add Playwright integration test
All checks were successful
ci/woodpecker/push/bun-verify Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
d8d7c42c70
Collaborator

Review Summary

This PR adds a minimal Playwright end-to-end integration test for the Astro/Bun production startup. The implementation is clean and well-structured: a focused smoke test, proper config using Nix-provided Chromium via PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH, explicit reuseExistingServer: false to prevent stale processes, and thorough documentation in both AGENTS.md and README.md explaining the known Bun/Astro adapter issue (app.pipeline.getLogger undefined).

The prior review already flagged the flake.nix fish shell change (confirmed intentional by author) and the performance consideration around rebuild-per-test. No new correctness or security issues found. The large bun.lock/bun.nix dependency bumps are routine version updates and not concerning on their own.


*🤖 Review by opencode (opencode/mimo-v2.5-free) — verdict: approve

# Review Summary This PR adds a minimal Playwright end-to-end integration test for the Astro/Bun production startup. The implementation is clean and well-structured: a focused smoke test, proper config using Nix-provided Chromium via `PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH`, explicit `reuseExistingServer: false` to prevent stale processes, and thorough documentation in both `AGENTS.md` and `README.md` explaining the known Bun/Astro adapter issue (`app.pipeline.getLogger` undefined). The prior review already flagged the `flake.nix` fish shell change (confirmed intentional by author) and the performance consideration around rebuild-per-test. No new correctness or security issues found. The large `bun.lock`/`bun.nix` dependency bumps are routine version updates and not concerning on their own. --- *🤖 Review by opencode (opencode/mimo-v2.5-free) — verdict: **approve** <!-- forgejo-opencode-review -->
clank-bot left a comment

Code review findings from opencode.

Code review findings from opencode. <!-- forgejo-opencode-review -->
@ -130,2 +130,4 @@
# Use the Nix browser instead of downloading Playwright browsers.
chromium
];
shellHook = ''
Collaborator
[bug] The default devShell's `shellHook` previously ended with `fish` (launching an interactive fish shell session). The new version replaced that with only the `PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH` export, removing the `fish` invocation. The postgres shell at line 178 still has `fish`. This looks like an accidental regression — users entering `nix develop` (default shell) will no longer get a fish shell. If this is intentional, it should be noted in the commit message; otherwise, `fish` should be restored.
<!-- forgejo-opencode-review --> [bug] The default devShell's `shellHook` previously ended with `fish` (launching an interactive fish shell session). The new version replaced that with only the `PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH` export, removing the `fish` invocation. The postgres shell at line 178 still has `fish`. This looks like an accidental regression — users entering `nix develop` (default shell) will no longer get a fish shell. If this is intentional, it should be noted in the commit message; otherwise, `fish` should be restored.
Author
Owner

This is intentional

This is intentional
martin marked this conversation as resolved
package.json Outdated
@ -9,6 +9,7 @@
"dev": "bunx --bun astro dev",
"build": "bun run generate && bunx --bun astro build",
"check": "bunx --bun astro check",
"test:e2e": "bun run build && bunx playwright test",
Collaborator
[performance] The `test:e2e` script runs `bun run build && bunx playwright test`, which performs a full production build (including OpenAPI codegen) on every test invocation. This is correct for the production-startup test's intent, but consider splitting into a `build` step and a `test:e2e` step (only `bunx playwright test`) so CI can skip the rebuild when the build artifact is already available. The `just integration-test` recipe could call `just build` then `bunx playwright test` separately.
<!-- forgejo-opencode-review --> [performance] The `test:e2e` script runs `bun run build && bunx playwright test`, which performs a full production build (including OpenAPI codegen) on every test invocation. This is correct for the production-startup test's intent, but consider splitting into a `build` step and a `test:e2e` step (only `bunx playwright test`) so CI can skip the rebuild when the build artifact is already available. The `just integration-test` recipe could call `just build` then `bunx playwright test` separately.
@ -0,0 +27,4 @@
],
webServer: {
// Use the compiled server to test production startup with Bun.
command: "HOST=127.0.0.1 PORT=4323 bun dist/server/entry.mjs",
Collaborator
[style] The `webServer.command` uses inline env vars (`HOST=127.0.0.1 PORT=4323`). This works on Linux/macOS but would fail on Windows. Since this project targets Bun on Linux (per AGENTS.md), this is acceptable, but worth documenting that cross-platform support is not intended.
<!-- forgejo-opencode-review --> [style] The `webServer.command` uses inline env vars (`HOST=127.0.0.1 PORT=4323`). This works on Linux/macOS but would fail on Windows. Since this project targets Bun on Linux (per AGENTS.md), this is acceptable, but worth documenting that cross-platform support is not intended.
Small fixes
All checks were successful
ci/woodpecker/push/bun-verify Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
70faf731a1
martin merged commit abce0ff363 into main 2026-09-11 19:17:51 +00:00
martin deleted branch tests/playwright 2026-09-11 19:17:51 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
martin/toolbox!51
No description provided.