Browse documentation

Node testing and guarantees

The Node runtime crosses process, PostgreSQL, replication, SQLite, and HTTP boundaries. Its test strategy separates focused contracts from full process scenarios so each result has a clear meaning.

Evidence by contract

ContractEvidence in this repositoryEstablished behaviorQualification boundary
Configuration and lifecycleConfiguration, CLI, ports, child process, health, and recovery testsDeterministic option resolution and lifecycle decisionsOptional platform binaries remain machine-specific
PGlite wire compatibilityProxy, IPC, pgoutput, publication, and compatibility testsCovered queries and replication framesFocused zero-cache PostgreSQL surface
Data propagationReal zero-cache startup and replication-latency scenariosCommitted changes reach clients in covered scenariosLatency and throughput depend on workload and hardware
Restore and recoveryRestore, live-restore, reset, restart, stale replica, and crash scenariosKnown local failure states converge through bounded recoveryDisk-loss recovery belongs to the project backup plan
Embedded PostgresStartup, integration, termination, replication, and orphan cleanup lanesReal PostgreSQL lifecycle and logical replicationLocal single-cluster scope
SQLite selectionMode resolution, native guard, WASM, and native startup lanesExplicit and reproducible SQLite selectionEach implementation needs its own performance measurement

Repository commands

bun run build
bun run check
bun run test

bun run test is the focused suite. CI also runs build, linting, formatting, type checking, and the native SQLite binary guard.

The process integration lane is:

bun run native:bootstrap
bun run test:integration

It starts real process trees and covers native startup, PGlite integration, Embedded Postgres, restart, restore, reset, and live-restore behavior.

Targeted iteration can run one contract directly:

bunx vitest run src/integration/native-postgres-backend.test.ts
bunx vitest run src/integration/restore-reset.test.ts
bunx vitest run src/replication/zero-compat.test.ts

Application CI

For the portable lane:

bunx orez --ephemeral \
  --force-wasm-sqlite \
  --migrations=./db/migrations \
  --on-healthy='bun run test:e2e'

Applications that depend on concurrent sessions, PostgreSQL locks, transaction scheduling, or native logical replication should add an Embedded Postgres lane for those contracts.

Record the Orez version, Zero version, database profile, SQLite implementation, operating system, and exact command with every reproducible result.

Qualification scope

Repository evidence covers the named local configurations and scenarios. Projects still qualify their own schema, optional PostgreSQL features, supported Zero version pair, client count, recovery objectives, latency target, throughput target, and production topology.