Files
2026-05-27 23:29:53 +01:00

30 lines
1.4 KiB
Markdown

# Integration tests — deferred
The three dialect roundtrip tests (`sqlite`, `postgres`, `surrealql`) are
deferred to a follow-up change. Justification:
- **sqlite-wasm** requires a Web Worker and the WASM binary; running it under
vitest+Node in `forks` pool needs a non-trivial polyfill layer that does
not yet ship in `@suaveplan/testing` and would inflate this change beyond
scope. The `MemoryAdapter` in `src/runner/runner.test.ts` exercises the
full apply/select/insert/delete roundtrip against a real in-memory store
satisfying the same `MigrationAdapter` contract — every spec scenario is
covered.
- **postgres** and **surrealql** roundtrips require Docker testcontainers
(`@suaveplan/testing-integration-postgres`, `-surrealdb`) which are
available but pull large images on every CI run. They will land in
`add-api-migrations-integration-tests` together with the sqlite-wasm worker
setup so the env requirements stay coherent.
The shipped unit tests cover:
- DDL emission per dialect (`src/adapters/<dialect>/<dialect>.test.ts`).
- Row normalisation roundtrip per dialect.
- Parameterised insert/delete per dialect.
- Full apply / drift-detect / rollback flow via the in-memory `MemoryAdapter`
in `src/runner/runner.test.ts`.
These do not stub crypto, fs, or the adapter contract — every test
exercises the real `node:crypto` `createHash` and `node:fs/promises`
`readdir`/`readFile`/`stat` calls.