test: cover notes CRUD and the PostgreSQL backend #8

Open
opened 2026-07-20 02:51:13 +02:00 by codinget · 0 comments
Owner

Goal

Close the remaining backend and API coverage gaps, especially the notes feature merged in PR #3 and the PostgreSQL backend once it lands.

Notes coverage

Add the notes operations to the reusable database contract suite and exercise them against both SQLite and the live HTTP/API backend:

  • create, list, fetch, update, and delete
  • list by abode and by creating user
  • full Note versus PartialNote response shape, including content omission
  • properties/type round trips
  • readonly behavior
  • validation and not-found behavior
  • authentication on user-scoped routes
  • 204 delete behavior and path-parameter handling

PostgreSQL coverage

When the PostgreSQL backend lands, run the same backend contract suite against a real PostgreSQL service. Also cover PostgreSQL-specific behavior:

  • migrations from an empty database and idempotent current-version migration
  • transaction commit and rollback, including JavaScript-defined migration parts using the active transaction
  • UUID, JSONB, and timestamp round trips
  • readonly mode
  • unique- and foreign-key error mapping
  • sessions, API keys, residents, and notes
  • connection cleanup and test isolation

Acceptance criteria

  • Shared behavior is expressed once in reusable contract tests rather than copied per backend.
  • SQLite, API, and PostgreSQL implementations run the applicable shared suites.
  • PostgreSQL tests use an isolated real service in CI, not mocks of pg.
  • Tests are deterministic and clean up servers, pools, and temporary databases.
  • The full suite is wired into the CI test gate.
## Goal Close the remaining backend and API coverage gaps, especially the notes feature merged in PR #3 and the PostgreSQL backend once it lands. ## Notes coverage Add the notes operations to the reusable database contract suite and exercise them against both SQLite and the live HTTP/API backend: - create, list, fetch, update, and delete - list by abode and by creating user - full `Note` versus `PartialNote` response shape, including content omission - properties/type round trips - readonly behavior - validation and not-found behavior - authentication on user-scoped routes - 204 delete behavior and path-parameter handling ## PostgreSQL coverage When the PostgreSQL backend lands, run the same backend contract suite against a real PostgreSQL service. Also cover PostgreSQL-specific behavior: - migrations from an empty database and idempotent current-version migration - transaction commit and rollback, including JavaScript-defined migration parts using the active transaction - UUID, JSONB, and timestamp round trips - readonly mode - unique- and foreign-key error mapping - sessions, API keys, residents, and notes - connection cleanup and test isolation ## Acceptance criteria - Shared behavior is expressed once in reusable contract tests rather than copied per backend. - SQLite, API, and PostgreSQL implementations run the applicable shared suites. - PostgreSQL tests use an isolated real service in CI, not mocks of `pg`. - Tests are deterministic and clean up servers, pools, and temporary databases. - The full suite is wired into the CI test gate.
codinget added the Kind/Testing
Priority
High
2
Agentic
labels 2026-07-20 02:51:13 +02:00
codinget added the
Agent
gpt-5.6-sol
label 2026-07-20 02:54:13 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: codinget/abode#8