ci(e2e): run the Playwright suite in CI - #329
Conversation
The 15 Playwright specs in tests/ only ever ran locally. Phase 1 of #44 wires them up so they can gate a PR. - test:e2e script (playwright test) - testDir: 'tests' — the default testDir is the config's own directory, so a bare `playwright test` also collected src/**/*.test.ts (the vitest specs) and aborted before running anything - explicit chromium project; forbidOnly under CI - trace retain-on-failure + screenshot only-on-failure, so the CI job has artifacts to upload; github + html reporters under CI - reuseExistingServer off under CI The matching ci.yml job is delivered as a patch in a PR comment: the GitHub App cannot push .github/workflows/. Refs #44
|
There was a problem hiding this comment.
VERDICT: approve
Rules Dobby 2, cycle 1. Non-blocking: one documentation accuracy nit, which I am fixing on this branch directly rather than looping the coder.
Rule check
Ran the relevant rules against the diff (three files), the commit message, the PR body, and the ci.yml patch in the comment above. Clean on:
- Conventional-commit PR title.
pr-title.ymlrunsamannn/action-semantic-pull-request@v6with notypes:allowlist, so the default list applies andci(e2e):is valid. The check is green. - Issue linking.
Phase 1 of #44andRefs #44are deliberate soft mentions for a partial fix, and GraphQLclosingIssuesReferencesis empty, so merging will not close #44. That matches the stated phase 2 scope. - Reviewer assigned (rubenhensen), base is main, all eight CI checks pass.
- Actions default shell has no
pipefail. Checked the comment patch specifically, since the bot cannot push.github/workflows/and a defect there lands via a maintainer's commit outside any diff review. Norun:block in the patch contains a shell pipe. Thepath: |underupload-artifactis a YAML block scalar, not a pipe. - The patch's action versions match the rest of the file (
checkout@v6,setup-node@v6on node 24 with npm cache,upload-artifact@v7),if: failure()is right for artifacts, and both upload paths are produced by the config in this diff and are already gitignored. - Prose. No banned vocabulary or structure tells in the PR body, commit message, or the CLAUDE.md additions. The
testDirand/opt/ms-playwrightnotes document non-obvious traps, which is documentation rather than justification narration.
The one finding
CLAUDE.md line 8 asserts as present-tense fact that CI runs npm run test:e2e as a PR gate in a job named E2E Tests. No such job exists. .github/workflows/ on this branch holds only ci.yml and pr-title.yml, and neither mentions playwright or e2e. The job lives only in the patch comment awaiting a maintainer, which the PR body states plainly ("Until it lands, nothing here gates a PR").
CLAUDE.md is auto-loaded agent context, so a future run could read line 8 and skip a local e2e run believing CI covers it. Line 9 already documents the workflows-permission limitation, so as written the two lines contradict each other.
Not a code defect and not worth a fix cycle, so I am rewording line 8 to describe the gate as pending and pushing it to this branch, then flipping the PR out of draft.
CLAUDE.md claimed CI runs `npm run test:e2e` in a job named `E2E Tests`. No such job exists yet: the ci.yml patch is in a PR comment waiting on a maintainer, so the line contradicted the workflows-permission note right below it. Since CLAUDE.md is auto-loaded agent context, a future run could skip a local e2e run believing CI covers it. Refs #44
|
/dobby the maintainer half is applied — your ci.yml patch landed verbatim on this branch as the |
|
Thanks for confirming! I'm on it — re-reviewing the applied |
Re-review of the applied commitDiffed 692bdab against the patch in my comment above: exact byte match, no drift. The job did what it was supposed to do on that commit. One follow-up commitb9668a9 flips the CLAUDE.md line back to present tense. When the job was still sitting in a comment, that line had to say the gate was pending (e719e45), otherwise CLAUDE.md would have told a future agent run that CI covers the e2e specs when nothing did. Now that the workflow and the docs line ship in the same tree, the pending wording is the stale one. CI is green on b9668a9, Also re-verified the failure path locally, since a gate that cannot go red is not a gate. With a spec added under One thing outside my reachThe repo's only ruleset on Nothing else outstanding from my side. The CLAUDE.md review thread is replied to and resolved. |
The CI job installs chromium with `--with-deps`, and copying that command locally fails: it shells out to `sudo apt-get`, which the workspace has no sudo for, and the whole install aborts. The line above already gives the working local invocation, so record why the CI form is not it. Refs #44
There was a problem hiding this comment.
VERDICT: approve
Rules Dobby 2, cycle 2. Re-reviewed the applied commit. No blocking findings.
The applied patch is byte-exact
Rather than take "landed verbatim" on trust, I extracted the proposed diff out of the patch comment and compared it to what you committed:
- proposed: comment 5092011678, the fenced diff block, 39 lines
- applied: 692bdab,
git show 692bdab --format='', 39 lines diffof the two: no output, exit 0
The test-e2e job is present in .github/workflows/ci.yml at HEAD cb6ff75 (line 51, name: E2E Tests), and it ran green on this HEAD in 1m24s. All nine checks pass and nothing is still in flight.
Rule check
Ran the rules that apply to a CI/config/docs diff against the four changed files, the five commit messages, the PR body, and the ci.yml patch. Clean on all of them.
patch-in-comment-gate-is-not-live-yet. This was cycle 1's finding, and the PR now satisfies both halves of it. e719e45 reworded the CLAUDE.md line to "pending" while the job existed only in a comment, 692bdab landed the job on the branch, and b9668a9 tightened the wording back to present tense in the same PR. Leaving the pending wording in after the job landed would have been the same defect pointing the other way.actions-default-shell-has-no-pipefail. Norun:block in the new job contains a shell pipe. Thepath: |underupload-artifactis a YAML block scalar. I checked this against ci.yml at HEAD rather than only in the diff, since a defect in a maintainer-applied workflow file lands outside any diff review.- Conventional-commit PR title.
ciis inamannn/action-semantic-pull-request's default type list and the workflow sets notypes:allowlist, soci(e2e):is valid. The check is green. - Issue linking.
Refs #44and "Phase 1 of #44" are deliberate soft mentions for a phased fix, andclosingIssuesReferencesis empty, so merging will not close #44. That matches the stated phase 2 scope. - Prose, across the PR body, all four commit messages and the CLAUDE.md additions. No banned vocabulary and no structural tells. The
testDirand/opt/ms-playwrightnotes record traps a later run would otherwise hit, which is documentation rather than narration. - PR is ready for review with a reviewer assigned, base is main.
One non-blocking note
CLAUDE.md line 8 and the PR body both call E2E Tests a "PR gate". I checked what actually enforces a merge here. The only active ruleset on main (id 14143032) has exactly three rules: deletion, non_fast_forward and pull_request. There is no required_status_checks rule, and required_approving_review_count is 0. So E2E Tests runs on every PR and reports pass or fail, but GitHub will not block a merge on a red run.
That is equally true of Unit Tests, Lint, Svelte Check and every other job in ci.yml, and line 7 has described test:unit as a "PR gate" since before this PR. The word is a pre-existing convention in this file rather than something #329 introduces, and rewording only the new line would leave the two lines inconsistent with each other. So I am not pushing a change for it and not sending the PR back.
If you want the word to be literally true, making the ci.yml jobs required status checks is a repo-settings change on your side. Worth doing for E2E Tests and Unit Tests at least, but separate from this PR.
Sign-off
The PR is complete. It is already out of draft, so there is nothing left for me to flip. Phase 2 stays on #44.
|
Re-reviewed the applied commit — confirmed. I diffed the proposed patch against your Posted a cycle-2 review: approve, no blocking findings. CI, PR-hygiene, and prose rules all came back clean. One non-blocking note I left in the PR rather than pushing to it: CLAUDE.md and the PR body call |
Phase 1 of #44: get the 15 Playwright specs in
tests/running as a CI gate. Part of encryption4all/postguard#247 wave 2.What is in the diff
test:e2escript (playwright test).playwright.config.ts:testDir: 'tests', an explicitchromiumproject,forbidOnlyunder CI,trace: 'retain-on-failure'andscreenshot: 'only-on-failure'so the CI job has something to upload, github + html reporters under CI,reuseExistingServer: falseunder CI..github/workflows/ci.yml: thetest-e2ejob (E2E Tests), applied by @rubenhensen in 692bdab because the GitHub App cannot push.github/workflows/. It is byte-identical to the patch in the comment below.CLAUDE.md: the "before claiming tests green" note pointed atnpm run test, which is not a script in this repo. Fixed, plus the two gotchas below.testDirwas the blocker. Playwright's default testDir is the config's own directory, sonpx playwright teston main also collectssrc/lib/components/filesharing/verifiedAttributes.test.ts(a vitest spec) and aborts withTypeError: Cannot read properties of undefined (reading 'config')before running a single browser test.The build stays inside Playwright's
webServer(npm run build && npm run preview, port 4173) instead of moving to a separate CI step, so CI and a local run take the same path. The build takes about 3 seconds, well inside the default 60 second webServer timeout.No retries are configured. A failing spec fails the job on the first attempt rather than being retried into green.
The gate is live
E2E Testsran on this branch and passed: 37 tests, 1m0s (job log). Thenpx playwright install --with-deps chromiumstep took about 20 seconds, so browser-cache keying is not worth the extra moving parts yet.Verified
E2E Testsamong them,Running 37 tests using 2 workersthen37 passed.CI=1 npm run test:e2e: 37 tests across the 15 spec files pass in 22s.tests/asserting a heading that does not exist, withCI=1. Exit code 1, andtest-results/<spec>-chromium/containedtest-failed-1.png,trace.zipanderror-context.md, with the html report inplaywright-report/. Both paths are already in.gitignore. That spec is not committed.npm run lint,npm run lint:css,npm run test:unit(14 pass),npx svelte-check --threshold warning(0 errors, 0 warnings).Phase 2 (the full send/receive flow matrix in the issue description) is out of scope, so #44 stays open.