Apply the #109 re-review: fork guard on the unit job, gated reachability check, renderer liveness assertion.
Tests / unit (pull_request) Successful in 17s
Tests / e2e (pull_request) Failing after 1m50s

act_runner mounts /var/run/docker.sock into every container job, so the fork guard
has to cover the unit job too. The e2e comment now states the blast radius of the
host DOCKER-USER exception instead of the removed container.options. Playwright deps
are narrowed to chromium, which is what Electron uses, and the homeserver reachability
curl gates with -f so a non-2xx fails the job.

The login test claimed "without crashing the app" but asserted only that the body had
text, which is true for an error page. It now asserts no uncaught renderer pageerror,
and toHaveValue after the homeserver commit proves fill() actually stuck.
This commit is contained in:
2026-11-03 12:51:11 +11:00
parent 73990d092c
commit 879a7155eb
2 changed files with 27 additions and 11 deletions
+15 -5
View File
@@ -10,6 +10,7 @@ const PASSWORD = process.env.E2E_PASSWORD;
let app;
let page;
let logs = [];
let pageErrors = [];
let profile;
// ServerPicker gives its input no name or test id, so position is the only handle on it;
@@ -30,6 +31,8 @@ async function chooseServer(server) {
await serverInput().fill(server);
// The server field commits on Enter, which re-runs discovery and reloads the auth flows.
await serverInput().press('Enter');
// fill() does not prove the value stuck; a cancelled debounce would keep matrix.org.
await expect(serverInput()).toHaveValue(server);
await expectLoginForm();
}
@@ -41,6 +44,7 @@ async function submitLogin(username, password) {
test.beforeEach(async () => {
logs = [];
pageErrors = [];
if (!PASSWORD) {
throw new Error('E2E_PASSWORD is not set. Export it, or add it as the CI secret.');
@@ -60,12 +64,17 @@ test.beforeEach(async () => {
?? await new Promise((resolve) => app.once('window', resolve));
}
page.on('console', (msg) => logs.push(`[renderer] ${msg.type()}: ${msg.text()}`));
page.on('pageerror', (err) => {
pageErrors.push(String(err));
logs.push(`[renderer] pageerror: ${err}`);
});
await chooseServer(HOMESERVER);
});
// Config-based screenshots and traces do not fire for a page taken from app.firstWindow(),
// and console capture is not covered by config at all, so this hook stays manual.
// Config-based screenshots do not fire for a page taken from app.firstWindow(), and console
// capture is not covered by config at all, so this hook stays manual. Traces stay off because a
// trace captures the login POST body.
test.afterEach(async ({}, testInfo) => {
if (!app) return;
@@ -119,8 +128,9 @@ test('failed login reports an error without crashing the app', async () => {
await expect(page.getByText('Invalid Username or Password.')).toBeVisible();
// The renderer is still alive and the form is still usable. No second login here: every
// run costs Synapse rc_login budget, and the re-login was the main source of flakes.
await expect(page.evaluate(() => document.body.innerText.trim())).not.toBe('');
// "Without crashing" needs a liveness signal: no uncaught renderer error, form still usable.
// No second login here: every run costs Synapse rc_login budget, and the re-login was the
// main source of flakes.
await expect(pageErrors).toHaveLength(0);
await expect(usernameInput()).toBeVisible();
});