Browser tests: draw every page in a bundled DejaVu Sans, locally as on CI #717

Closed
opened 2026-10-04 20:43:12 +00:00 by tiagoagueda · 1 comment
Owner

Measured from Forgejo's task API and job logs, runs 561–710 (24 Sep – 4 Oct 2026): wall time per push about 52–55 min, up from about 15; the browser suite grew from 149 to 645 tests in five days and runs serially (29 min); the runner takes two jobs at a time, in the order the workflow file lists them, so the browser job starts 19–22 min after the push; and Forgejo cancels the older push run when a newer push lands, which stopped 18 of 56 browser jobs before they gave a verdict.

Four of the six CI browser failures in the window were the font: CI draws in DejaVu Sans, a Windows desktop in Segoe UI, which is narrower (runs 569 and 612, text spacing; 596, the footer's rows, #212; 602, the Greek agenda at 320 pixels, #316). Each passed locally and failed on CI. POSTULO_E2E_FONT="DejaVu Sans" (tests/e2e/conftest.py:133) draws a local run the way CI does, but only when somebody remembers it, and only where the font is installed: its rule is !important with no fallback, so a machine without DejaVu draws the whole suite in Times.

Proposal

  • Commit DejaVu Sans and DejaVu Sans Mono under tests/e2e/fonts/ (their licence allows it).
  • The suite always serves them, with @font-face rules appended to the application's stylesheet by the same patched static handler, on CI and locally alike. The content security policy already allows fonts from the site.
  • The session fails at its start, with a sentence saying why, if document.fonts.check says the font did not load.

Rasterising still differs a little between platforms, but advance widths come from the font, so a line that wraps on CI wraps locally.

Done when

  • A plain uv run pytest -m e2e on Windows draws in DejaVu Sans, and so does CI.
Measured from Forgejo's task API and job logs, runs 561–710 (24 Sep – 4 Oct 2026): wall time per push about 52–55 min, up from about 15; the browser suite grew from 149 to 645 tests in five days and runs serially (29 min); the runner takes **two jobs at a time, in the order the workflow file lists them**, so the browser job starts 19–22 min after the push; and Forgejo cancels the older push run when a newer push lands, which stopped 18 of 56 browser jobs before they gave a verdict. Four of the six CI browser failures in the window were the font: CI draws in DejaVu Sans, a Windows desktop in Segoe UI, which is narrower (runs 569 and 612, text spacing; 596, the footer's rows, #212; 602, the Greek agenda at 320 pixels, #316). Each passed locally and failed on CI. `POSTULO_E2E_FONT="DejaVu Sans"` (`tests/e2e/conftest.py:133`) draws a local run the way CI does, but only when somebody remembers it, and only where the font is installed: its rule is `!important` with no fallback, so a machine without DejaVu draws the whole suite in Times. ## Proposal - Commit DejaVu Sans and DejaVu Sans Mono under `tests/e2e/fonts/` (their licence allows it). - The suite always serves them, with `@font-face` rules appended to the application's stylesheet by the same patched static handler, on CI and locally alike. The content security policy already allows fonts from the site. - The session fails at its start, with a sentence saying why, if `document.fonts.check` says the font did not load. Rasterising still differs a little between platforms, but advance widths come from the font, so a line that wraps on CI wraps locally. ## Done when - A plain `uv run pytest -m e2e` on Windows draws in DejaVu Sans, and so does CI.
Author
Owner

Follow-up e8f050a57: run 723 failed the masthead test under the text spacing override on three pages, deterministically, with the bundled font, though it passed locally with the same files (and with Debian's copies). Chromium on Linux renders a web font differently from the same font installed. Each @font-face now names the installed DejaVu first (local()), so CI draws exactly what it drew before; the bundled files, now Debian's fonts-dejavu-core 2.37-6 byte for byte, serve a machine with no DejaVu.

Follow-up `e8f050a57`: run 723 failed the masthead test under the text spacing override on three pages, deterministically, with the bundled font, though it passed locally with the same files (and with Debian's copies). Chromium on Linux renders a web font differently from the same font installed. Each `@font-face` now names the installed DejaVu first (`local()`), so CI draws exactly what it drew before; the bundled files, now Debian's `fonts-dejavu-core` 2.37-6 byte for byte, serve a machine with no DejaVu.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#717
No description provided.