Skip to content

Building and testing

Toolchain

Antiphon builds on current stable Rust; Alpine CI pins the MSRV floor, so anything the floor accepts is fair. Native dependencies are the notmuch library and, for the live PGP tests, a gpg capable of ephemeral homes.

git clone https://git.sr.ht/~donquinleone/antiphon
cd antiphon
cargo build --workspace

The gate

Every change passes the same three commands before it is committed, hard-chained so a failure cannot slip past:

cargo fmt --all --check \
  && cargo clippy --workspace --all-targets -- -D warnings \
  && cargo test --workspace

CI runs the gate on Arch (stable, plus a query performance smoke test), Alpine (MSRV and musl), a LUKS2 leg that exercises the vault against a real loop device, and a NixOS leg that builds the flake and runs the workspace tests inside its sandbox (which is how missing check-phase inputs get caught).

Test conventions

  • Unit tests live with their module; integration tests that need a real store build one in a tempdir (they are cheap: the store is just directories, notmuch and files).
  • TUI rendering is tested against ratatui's TestBackend with position-pinning assertions, so a regression moves a visible cell, not a mock.
  • Live IMAP tests exist but only run where the environment provides a test account; they skip silently elsewhere.
  • Anything driving tokio timers must run entered on the session runtime; the offline tests cannot catch a bare timeout() construction, and one has panicked live before.

Performance

The store is expected to stay fast at six figures of mail. A synthetic 300k-message store generates in under a minute:

cargo run --release -p antiphon-store --example mailgen -- \
    --root /tmp/store300k --messages 300000 --accounts 6 --seed 42
cargo run --release -p antiphon-store --example querybench -- \
    /tmp/store300k

Reference numbers on an M-class laptop: open ~2ms, 500-row list window ~85ms, scoped body search ~35ms. querybench takes --assert-under <ms> for use as a regression gate.

Dummy data only

Fixtures, examples, seeds and docs use invented names and example.com addresses, never real people or real domains.