You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(webapp): stop unit tests reaching env-configured Redis/Postgres in CI
CI runners have no .env, no REDIS_HOST/REDIS_PORT, and no Postgres at
localhost:5432, which surfaced two failure layers that local runs mask
(the dev stack answers on both):
- suites transitively importing triggerTaskV1.server failed to collect
because autoIncrementCounter.server.ts throws at import when
REDIS_HOST/REDIS_PORT are unset (shards 2/5/6). Default the pair in
test/setup.ts — the global ioredis lazyConnect mock means nothing dials.
- TriggerFailedTaskService.call() resolved its event repository via
getEventRepository → global prisma (feature-flag read + Prisma event
repo), so in CI the swallowed connect error returned null friendlyIds
(shard 8). Allow injecting the repository/store pair and bind the test
to an EventRepository over the testcontainer DB.
- once the cancelDevSessionRuns suite could collect, findLatestSession's
hardwired global $replica was the next masked layer; give it an
injectable client (defaulting to $replica) and pass the service's
_replica through.
Verified by replaying the exact CI env locally (.env hidden, workflow env
vars, dead localhost DB, GITHUB_ACTIONS set): all four failing suites and
full shards 2/5/6/8 reproduce the CI failures before and pass after.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments