The test suite is self-contained: each test binary starts its own throwaway
database containers (SurrealDB, PostgreSQL, MySQL, MongoDB, Neo4j, Kafka) on
demand via Docker, using random ports and per-test databases/namespaces for
isolation (see src/testing/shared_containers.rs).
This means you only need two things to build and test locally:
- A working Docker daemon.
- The Rust toolchain + a few system build dependencies.
You can work either natively on your host or inside the devcontainer.
-
Install the system build dependencies:
make system-deps
- macOS: installs
openssl@3,pkg-config,cmake,protobufvia Homebrew. TheMakefileautomatically points cargo at Homebrew's OpenSSL. - Debian/Ubuntu: prints the
apt-getcommand to run (build-essential cmake libssl-dev libsasl2-dev pkg-config protobuf-compiler postgresql-client).
- macOS: installs
-
Install the toolchain components and
cargo-nextest:make install-tools
-
Make sure Docker is running, then:
make test
make test formats, runs clippy, builds the debug binary, then runs the full
suite with cargo-nextest (which parallelizes tests across
the whole workspace) plus the doctests. Tuning of test concurrency lives in
.config/nextest.toml.
The devcontainer (.devcontainer/surreal-sync)
provides the build environment plus a Docker daemon (via the docker-in-docker
feature), which is all the tests need.
- Open the project in VS Code/Cursor.
- Select "Reopen in Container".
- Run
make test.
The devcontainer no longer runs long-lived database services — the tests start their own, exactly as they do natively.
- "Cannot connect to the Docker daemon": ensure Docker Desktop / the daemon is
running. The tests shell out to
docker run. - Leftover containers after an interrupted run:
docker ps -athendocker rm -f <name>(test containers are namedshared-*,test-*). - macOS build errors about
openssl/ssl.hnot found: runmake system-deps(the Makefile setsOPENSSL_DIR/CFLAGSfor Homebrew OpenSSL automatically).