docs-internal/engine/TEST_DEPENDENCIES.md
The rivet-test-deps package provides isolated test environments with configurable database and pub/sub backends.
Configure backends via environment variables:
RIVET_TEST_DATABASE: Choose database backend
foundationdb - Runs FoundationDB in Dockerpostgres - PostgreSQL in Dockerfilesystem - RocksDB with temp directory (default)RIVET_TEST_PUBSUB: Choose pub/sub backend
nats - Runs NATS in Dockerpostgres_notify - PostgreSQL in Dockermemory - In-memory channels (default)RUST_LOG: Enable debug logs to see container lifecycle details
RUST_LOG=debug will enable more verbose logslet deps = TestDeps::new().await?;
// Use deps.pools() and deps.config() for your tests
// Containers are cleaned up automatically when deps is dropped
For multi-datacenter tests:
let deps = TestDeps::new_multi(&[1, 2, 3]).await?;