mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The journey's isolation went one way only. `test.describe.configure` orders the tests inside the file; the suite is fullyParallel with two workers, so everything else runs beside it — and its own trigger, the admin reminder sweep, walked the whole instance and dispatched for every account that had an overdue dose. With the mail env pointed at the local responder, that would have started sending real messages for accounts this file has never heard of, and the exact-equality assertion on the accepted recipients would have been reading them. The sweep now names the account it then counts, and the comments that defended the opposite direction say what the exposure actually is. Its own server, too, and for two reasons. The `SMTP_*` vars decide whether the Email card renders at all, so on the shared server they put a card the axe scan and the card-anatomy sweep had never measured onto `/settings/integrations` for every spec that opens the route. And unset, `HEALTHLOG_PROCESS_TYPE` starts the pg-boss reminder scheduler inside the process serving requests, whose every-fifteen-minutes tick either mints the missed-dose row that makes the sweep skip its own dispatch or dispatches beside it. A third server carries both: mail configured, `web`, and only this spec talks to it. The shared server keeps `all` on measured grounds rather than taste. Worker status is per-process and in-memory, so a `web` process reports the worker stopped, `/admin` renders that row destructive-red, and axe fails it at 3.97:1 against the muted tile — a real contrast defect any operator running the documented web/worker split already sees, and not this branch's to fix. That limit is written where the server is defined. Also here: the stub draws its port per run instead of pinning one, and says so by name when the port is taken; teardown ends its sockets and survives a setup that never got as far as starting it; the ledger reset stops deleting rows whose subject is this account but whose recipient is somebody else, and clears intake events explicitly rather than through a cascade; the attempt poll refuses a window larger than the twenty rows the diagnostic returns; and the header names the precondition the file cannot enforce and the internal reasons it pins on purpose. Verified against a production build and a throwaway Postgres: the journey three times over at one worker, then the a11y and settings geometry specs at two. Both assertions broken once to see them fail.
44 lines
2.4 KiB
TypeScript
44 lines
2.4 KiB
TypeScript
/**
|
|
* The third E2E server: the one configured for mail, and the one with no
|
|
* scheduler.
|
|
*
|
|
* Two things the notification-dispatch journey needs are wrong for every other
|
|
* spec, so it gets its own process rather than bending the shared one.
|
|
*
|
|
* **Mail.** `SMTP_HOST` / `SMTP_PORT` / `SMTP_FROM` are operator config, and
|
|
* `isEmailConfigured()` is what decides whether the Email card renders at all
|
|
* (`src/components/settings/email-card.tsx`). Putting them on the shared server
|
|
* would put that card on `/settings/integrations` for every spec that opens the
|
|
* route — the axe scan and the card-anatomy geometry sweep included — and make
|
|
* this branch responsible for a surface it does not touch. Here, the shipped
|
|
* "no SMTP, no card" state stays what every other spec observes.
|
|
*
|
|
* **No scheduler.** Unset, `HEALTHLOG_PROCESS_TYPE` reads "all" and
|
|
* `src/instrumentation.ts` starts the pg-boss reminder worker inside the
|
|
* process serving requests, which schedules `medication-reminder-check` every
|
|
* fifteen minutes. The journey keeps a medication overdue for the length of a
|
|
* test, and a tick inside that window either mints the missed-dose row that
|
|
* makes the sweep skip its own dispatch or dispatches beside it and adds a
|
|
* ledger row the count was not expecting. `web` is the shipped, documented
|
|
* value for HTTP-without-scheduler (docs/self-hosting/scaling.md); the pg-boss
|
|
* PRODUCER still starts, so a route that enqueues work keeps working, and the
|
|
* journey's own trigger is a route rather than a job.
|
|
*
|
|
* The shared server keeps "all" deliberately, and the reason is measured
|
|
* rather than assumed: `getWorkerStatus()` is per-process in-memory, so a `web`
|
|
* process reports the worker stopped, `/admin` renders that row
|
|
* `text-destructive`, and axe fails it at 3.97:1 against the muted tile. That
|
|
* is a real contrast defect, visible to any operator running the documented
|
|
* web/worker split, and it is not this branch's to fix. What it means here is
|
|
* that the scheduler still exists on the suite's shared process: it is off in
|
|
* the process the journey drives, not off in the run.
|
|
*
|
|
* With `E2E_SKIP_WEB_SERVER=1` no server is started for you and all three have
|
|
* to be running — the same contract the other two already carry.
|
|
*/
|
|
export const NOTIFICATION_PORT = 3200;
|
|
|
|
export const NOTIFICATION_BASE_URL =
|
|
process.env.E2E_NOTIFICATION_BASE_URL ??
|
|
`http://localhost:${NOTIFICATION_PORT}`;
|