Skip to content

fix(tests): keep two backend tests independent of runner tz and fonts - #261

Merged
kinqsradio merged 1 commit into
feat/web-rebuildfrom
fix/ci-env-drift-tests
Nov 6, 2026
Merged

kinqsradio merged 1 commit into
feat/web-rebuildfrom
fix/ci-env-drift-tests

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Change

Backend CI fails on every PR into feat/web-rebuild since the runner environment changed after 3 Nov. No app code changed.

  • saved-views.test.ts date parity: CI's postgres:17-alpine now ships tzdata 2026f, where Cuba stays on UTC−4 on 1 Nov 2026. Node's ICU still falls back. The test now compares Postgres and Node offsets around each anchor, skips only the pairs that disagree, logs them, and fails if more than two drift.
  • pdf-preview-runtime.unit.test.ts paint: the test drew non-embedded Helvetica from runner system fonts, and the new Ubuntu image has none. It now uses PDF.js's bundled standard fonts plus the canvas Path2D, the same setup as imports/pdf.ts.

Product note: a Havana user's "today" can differ between server filtering and the client until Node's tz data catches up.

Checks and limits

  • Both test files pass against Postgres with tzdata 2026f (CI's new image digest 5d9ee3…; only America/Havana 2026-11-01 skipped) and 2026e (old digest 266d3c…; nothing skipped): 18/18.
  • In a font-less node:22-bookworm-slim container, the new PDF setup paints 520 dark pixels (the old setup painted 0).
  • Prettier, backend typecheck and code-organization check pass.
  • Full backend suite not rerun locally; CI on this PR covers it.

AI usage

  • Tool: Claude Code (desktop). Model: Claude Opus 5.5, medium effort.
  • Human role: chose the approach and asked for this PR. Diagnosis, edits and checks were done by the agent.
  • No external sources copied.

Workspace

  • Used the outer Orbyn Engineering workspace with this target nested under repo/, and read the relevant project guides.

🤖 Generated with Claude Code

- Date parity: skip zone/anchor pairs where Postgres and Node tz
  databases disagree on offsets (tzdata 2026f keeps Havana on UTC-4 on
  1 Nov 2026), log what was skipped, and fail if more than two drift.
- PDF.js paint: render with the bundled standard fonts and the canvas
  Path2D, as imports/pdf.ts does, instead of runner system fonts.
@kinqsradio
kinqsradio merged commit 4a6245b into feat/web-rebuild Nov 6, 2026
7 checks passed
@kinqsradio
kinqsradio deleted the fix/ci-env-drift-tests branch November 7, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant