Commit 6608555
committed
test(webapp): keep billing unit tests green when CI infra is unreachable
CI unit-test workers have no global Postgres/Redis on localhost (testcontainers
use random ports). Two latent fragilities surface once new test files shift the
shard layout:
- Modules build a Redis-backed singleton at import (auto-increment counter via
triggerTask.server) and throw during collection when REDIS_HOST is unset.
- Shared background singletons (OrganizationDataStoresRegistry) poll the global
database at startup and reject async, which vitest flags as unhandled.
Set harmless REDIS_HOST/PORT defaults, swallow only the Prisma P1001
"can't reach database" unhandled rejection (other rejections stay fatal), and
inject a runs-repository stub in the dedupe unit test so it does not reach the
production clickhouse factory. Temporary infra workaround; owner: platform.1 parent b504fcb commit 6608555
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments