improvement(tests): db-mock migration tranche 1 — knowledge, billing/org, workflows/background#5861
Conversation
…kground suites off private @sim/db factories
…org, workflows/background
- migrate 19 suites off private vi.mock('@sim/db') factories onto the shared
dbChainMock + queueTableRows API (net ~-1,260 lines of bespoke chain
plumbing); resolves the known shared-worker rival pairs (knowledge
processing-queue vs api utils; billing polluters; persistence/utils vs
schedules/deploy)
- add .for() to the mock's limit builder (drizzle .limit(1).for('update'))
with a contract test
- document the join-table queue fallback footgun on queueTableRows
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The shared mock gains No production routes or services change—only Reviewed by Cursor Bugbot for commit 00a06cb. Configure here. |
Greptile SummaryThis PR moves the first group of database tests onto the shared mock infrastructure. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "improvement(tests): db-mock migration tr..." | Re-trigger Greptile |
Summary
vi.mock('@sim/db', <factory>)implementations onto the shareddbChainMock+queueTableRowsAPI from improvement(testing): consolidate @sim/db mocks into one table-aware chain mock #5856 — net ~−1,260 lines of bespoke chain plumbingprocessing-queue↔api/knowledge/utils, the billing polluters (lock-order,dashboard-credit-grant,subscription), andworkflows/persistence/utils↔schedules/deploy.for()to the mock's limit builder so drizzle's.limit(1).for('update')row-lock form chains (found by the migration; contract test added)queueTableRowsType of Change
Testing
Full apps/sim suite green locally (13704/13705; sole failure is the known local ripgrep dependency, green in CI). Each migrated file verified standalone, per-cluster in shared-worker runs, and with neighbor sweeps (
lib/billing lib/admin462 tests,lib/workflows background1061 tests, knowledge cluster 231 tests). tsc + biome clean.Checklist