Symptom
deploy-server.yml is blocked on every push to main because the Run tests gate fails. The deploy step never runs, so the Railway server has not received a deploy in this pipeline since at least 2026-05-15 (commit 90df5772).
Confirmed pre-existing — NOT caused by PR #66 (v1.31 Phase 0) or PR #67 (Q1 Genome 2.0 + WAD-D). Same deploy failed identically on 90df5772 before either landed.
Reproduction
11 failures, all in billing tests:
| Route |
Failing tests |
| `POST /billing/checkout` |
4 |
| `GET /billing/portal` |
1 |
| `POST /billing/webhook` |
6 |
All share the same error:
TypeError: undefined is not an object (evaluating 'stripe.checkout.sessions')
Root cause (per the fix in #68)
The Stripe SDK constructed with a stub key lazily resolves resource attributes — `stripe.checkout`, `stripe.webhooks`, `stripe.billingPortal` come back as `undefined` on the CI bun runtime (1.3.14) but are fully populated on the local bun (1.3.13). A neighboring test (`admin-user-detail.test.ts`) already uses `mock.module("../src/lib/stripe.js", ...)` to side-step this; when both files share a process the side-effect leaks and makes `billing.test.ts` accidentally green locally. CI ran `billing.test.ts` early enough that the leak hadn't occurred, so the 11 calls against `stripe.checkout.sessions` / `stripe.webhooks.constructEvent` threw.
Fix shipped in #68
Option A from the issue plan: a test-setup module mock at the top of `server/tests/billing.test.ts` that calls `mock.module("../src/lib/stripe.js", ...)` before importing the app. Zero production code changed.
Impact (now resolving)
Failing run IDs
Fix tracked in PR #68.
Symptom
deploy-server.ymlis blocked on every push tomainbecause the Run tests gate fails. The deploy step never runs, so the Railway server has not received a deploy in this pipeline since at least 2026-05-15 (commit90df5772).Confirmed pre-existing — NOT caused by PR #66 (v1.31 Phase 0) or PR #67 (Q1 Genome 2.0 + WAD-D). Same deploy failed identically on
90df5772before either landed.Reproduction
11 failures, all in billing tests:
All share the same error:
Root cause (per the fix in #68)
The Stripe SDK constructed with a stub key lazily resolves resource attributes — `stripe.checkout`, `stripe.webhooks`, `stripe.billingPortal` come back as `undefined` on the CI bun runtime (1.3.14) but are fully populated on the local bun (1.3.13). A neighboring test (`admin-user-detail.test.ts`) already uses `mock.module("../src/lib/stripe.js", ...)` to side-step this; when both files share a process the side-effect leaks and makes `billing.test.ts` accidentally green locally. CI ran `billing.test.ts` early enough that the leak hadn't occurred, so the 11 calls against `stripe.checkout.sessions` / `stripe.webhooks.constructEvent` threw.
Fix shipped in #68
Option A from the issue plan: a test-setup module mock at the top of `server/tests/billing.test.ts` that calls `mock.module("../src/lib/stripe.js", ...)` before importing the app. Zero production code changed.
Impact (now resolving)
Failing run IDs
Fix tracked in PR #68.