fix(e2e): bound the Playwright run and make a failed login say why (closes #161) #165

Merged
not merged 6 commits from fix/161-e2e-bounded-and-diagnosable into main 2026-09-04 10:53:37 +00:00
6 Commits
Author SHA1 Message Date
not 7a4ec72f43 Merge remote-tracking branch 'origin/main' into fix/161-e2e-bounded-and-diagnosable
CI / lint (pull_request) Successful in 2m19s
CI / build (pull_request) Successful in 1m9s
CI / unit (pull_request) Successful in 1m29s
CI / frontend (pull_request) Successful in 3m4s
CI / mutation (pull_request) Successful in 6m7s
CI / verify-stack (pull_request) Successful in 10m0s
2026-09-04 11:49:30 +02:00
notandClaude Opus 5 ab1d824e1e docs(ci): a killed job loses its if: always() steps — gotchas §9 (refs #161)
CI / lint (pull_request) Successful in 1m29s
CI / unit (pull_request) Canceled after 0s
CI / frontend (pull_request) Canceled after 0s
CI / mutation (pull_request) Canceled after 0s
CI / verify-stack (pull_request) Canceled after 0s
CI / build (pull_request) Canceled after 40s
Records what #161's job metadata actually shows (steps 15-18 as 0-second
failures stamped at the kill), how to read step timings via the API instead of
trusting a truncated log, and the two conventions that follow: bound the work
inside the tool so it can still report, and never let an auto-waiting
Playwright action serve as the timeout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 11:46:56 +02:00
notandClaude Opus 5 e7d4ed8ad4 fix(e2e): fail fast when a portal never reaches Keycloak, and bound the run (refs #161)
Two defects behind #161's opaque 36-minute verify-stack job.

**A login that never gets its form ate the test timeout.** `fill()` auto-waits
until the *test* timeout (90s), not the 15s expect timeout, so a portal that
serves its page but never bootstraps — its config.json fetch or the OIDC
discovery behind `authorize()` failed, and main.ts only console.errors — spent
90 seconds to report `locator.fill: Test timeout of 90000ms exceeded`: the
symptom, not the cause. That is catalogus.spec's 1.8 minutes in the issue.
Both Keycloak forms are now asserted visible first, with a 20s budget and a
message naming the step that never happened.

Verified against a real blank-bootstrap portal (a beheer image served with a
config.json that is not JSON): fails in 20.2s with
"the Keycloak login form never appeared — the portal did not reach Keycloak
(check its config.json fetch and the OIDC discovery …)".

**A wedged suite consumed the job.** Nothing bounded the run, so CI killed the
job — and with it the `if: always()` steps that would have explained the
failure: neither the per-spec summary nor the container-log dump ran (both show
0-second failures at the kill in run 739's metadata). `globalTimeout` makes
Playwright stop and *report* instead, so the JSON report is written and those
steps still run. 12 minutes over a ~1-minute suite: a backstop, not a budget.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 11:46:28 +02:00
notandClaude Opus 5 27f2607e4e refactor(e2e): route every portal login through one Keycloak helper (refs #161)
`medewerker-login.ts` becomes `keycloak-login.ts`: the three citizen specs
each duplicated the same three-line password login, so a fix to the login path
had to be made four times. They now call `loginBurger`, and both realms share
`submitPassword`.

No behaviour change — all 6 specs green against a live stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 11:44:30 +02:00
notandClaude Opus 5 779f0deb5a fix(ci): carry the failing spec's error into the e2e job summary (refs #161)
The per-spec table now has a "Why" column holding the spec's first error,
flattened for a markdown cell: ANSI stripped, newlines collapsed, `|` escaped
(a real report's message is multi-line, coloured, and embeds source-snippet
gutters), clipped to 300 chars. The column only appears when something failed.

So a red e2e names its cause in the summary even when the log is truncated or
the run is killed mid-stream — which is the state #161 was filed from.

Shape verified against an actual @playwright/test 1.61 failing report, not
just the fixture.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 11:41:45 +02:00
notandClaude Opus 5 699fef4e68 test(ci): the e2e job summary must name why a spec failed (refs #161)
#161 lost a 36-minute verify-stack job whose only surviving output was a
single ✘ line: the per-spec summary (#136) renders a verdict icon and nothing
else, so a red e2e still costs a log dive — and when the log is truncated or
the run is killed, there is nothing to dive into.

Adds a stdlib assert-based self-check for infra/playwright-summary.py (no
framework) and rides it on `make unit` so CI catches a broken summary.
Fails with "AssertionError: Test timeout of 90000ms exceeded" not in the
rendered markdown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 11:40:35 +02:00