Files
pl_mail/package.json
T
Paul LütznerandClaude Opus 5 24a5ab3de1 build: mercure 0.8, and a database of PHPUnit's own
MERCURE 0.5.0 / symfony/mercure 0.8.0, kept out of the earlier sweep
because it carries the live-update transport and should not ride along
with eighteen patch bumps. It earned that: HubInterface gained
getProtocolVersion() and getCookieName(), so the two hub doubles in
CalendarSyncFinishedNotificationTest stopped satisfying it — a fatal
error, not a failing test. Both implement them now, returning what a real
hub would rather than pretending to configuration these tests do not
have. Verified where it matters: the full browser suite, including the
specs that stop and restart the hub to prove the stream recovers.

A DATABASE OF ITS OWN for the unit suite.

Both suites run APP_ENV=test, and doctrine.yaml's
`dbname_suffix: '_test%env(default::TEST_TOKEN)%'` therefore pointed both
at app_test. One database, two suites — and one test in here truncates
real tables, because exercising a data reset is its whole purpose.

Sequentially that is safe; Postgres rolls a TRUNCATE back like anything
else. Concurrently it is not: TRUNCATE takes an ACCESS EXCLUSIVE lock, so
live queries from the browser suite block until the unit test's
transaction ends, and specs with no connection to any of this report
timeouts. It fits the transaction abort seen here once and never
reproduced.

TEST_TOKEN is Symfony's own mechanism for exactly this, so the fix uses
it rather than inventing a second DATABASE_URL. bin/test-unit.sh sets it
and does the create/migrate/seed a fresh database needs.

The seeding is the part worth guarding: PageRendersTest, ListFragmentTest
and others SKIP THEMSELVES when the admin user is missing, so without it a
green run would quietly be ~50 tests smaller than it looks — a worse
failure than a red one. Checked rather than assumed: 4047 tests either
way, no skipped or incomplete markers.

The assertion count moved, 11540 → 11526, and settled there across runs.
That is the point of the change showing up: the unit suite was reading
rows the browser stack had left behind, and now it reads only its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 15:08:17 +02:00

33 lines
1.7 KiB
JSON

{
"name": "plmail-e2e",
"private": true,
"description": "End-to-end tests for plMail (Playwright). Separate from the app's AssetMapper/importmap frontend.",
"scripts": {
"test:env:up": "docker compose -f compose.test.yaml up -d --build --wait app",
"test:env:down": "docker compose -f compose.test.yaml down",
"test:env:reset": "docker compose -f compose.test.yaml down -v",
"test:env:logs": "docker compose -f compose.test.yaml logs -f app",
"test:unit:docker": "npm run test:env:up && docker compose -f compose.test.yaml run --rm --no-deps --entrypoint docker-php-entrypoint app sh bin/test-unit.sh",
"test:e2e:docker": "npm run test:env:up && playwright test",
"test:e2e:docker:ui": "npm run test:env:up && playwright test --ui",
"test:e2e:docker:headed": "npm run test:env:up && playwright test --headed",
"test:e2e:docker:trace": "npm run test:env:up && playwright test --trace on --video on",
"test:e2e": "playwright test",
"test:e2e:site": "php bin/build-site.php && E2E_SITE=1 playwright test site.spec.ts",
"test:e2e:screenshots": "E2E_SCREENSHOTS=1 playwright test screenshots.spec.ts",
"test:e2e:coverage": "rm -rf var/js-coverage && E2E_JS_COVERAGE=1 playwright test && node bin/js-coverage.mjs",
"test:e2e:ui": "playwright test --ui",
"test:e2e:headed": "playwright test --headed",
"test:e2e:report": "playwright show-report",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"engines": {
"node": ">=18"
},
"devDependencies": {
"@playwright/test": "^1.62.1",
"@types/node": "^26.1.2",
"typescript": "^7.0.2"
}
}