Skip to content

HYDI-36: Phase 5: Postgres integration tests for db/queries.ts (opt-in)#27

Draft
kasperwelner wants to merge 1 commit intomainfrom
agent/HYDI-36
Draft

HYDI-36: Phase 5: Postgres integration tests for db/queries.ts (opt-in)#27
kasperwelner wants to merge 1 commit intomainfrom
agent/HYDI-36

Conversation

@kasperwelner
Copy link
Copy Markdown
Contributor

@kasperwelner kasperwelner commented May 7, 2026

Implements HYDI-36

Changes

  • Added an opt-in integration suite at src/db/queries.integration.test.ts that executes src/db/schema.sql and validates SQL-heavy behavior in src/db/queries.ts:
    • upsertDispatchRun insert + ON CONFLICT summary preservation via COALESCE
    • removeBlocker array removal behavior, including last-blocker transition to queued from blocked_cycle
    • updateRunStatus partial update behavior and null-vs-undefined semantics (blocked_by clears on null, pr_url unchanged on null)
    • getRunsBlockedBy array containment and getActiveRunCount
    • Additional integration coverage for project config lookups and list/delete helpers
  • Added scripts/test-db.sh and wired npm run test:db:
    • Uses disposable Docker Postgres on port 5433 when Docker is available
    • Falls back to in-process PGlite when Docker is unavailable, while preserving query-level integration assertions
  • Updated vitest.config.ts include globs to recognize *.integration.test.ts
  • Updated docs/testing.md with a new DB integration test section (gating, invocation, fallback mode, and semantic examples)

Validation

  • npm test (integration tests skipped cleanly by default)
  • npm run test:db
  • RUN_DB_TESTS=1 TEST_DB_MODE=pglite ... npm run test:coverage -- --testNamePattern integration
    • src/db/queries.ts coverage: 100% statements
  • npm run typecheck

Co-Authored-By: Oz oz-agent@warp.dev

Conversation: https://app.warp.dev/conversation/d456a216-89da-481f-b59c-5b75804085b1
Run: https://oz.warp.dev/runs/019e0401-2335-762a-bee5-7806f7179e4b
This PR was generated with Oz.

@hyperbolic-coolify
Copy link
Copy Markdown

hyperbolic-coolify Bot commented May 7, 2026

The preview deployment for hyper-dispatch is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-05-07 20:02:47 CET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant