tpt-dx-testing
RustErgonomic testing DX toolkit for Rust — async trait mocking, snapshot testing, fixture loading, testcontainers, CI helpers, property-based generators, and more. 10 focused crates, tokio + cargo-nextest friendly.
Languages
tpt-dx-testing
A suite of Rust crates that remove the daily-pain points of writing tests: async trait mocking, snapshot testing, fixture loading, testcontainers wrapping, CI helpers, property-based generators, safe env-var mutation, fluent JSON assertions, benchmark diffing, and log-capture-on-failure.
Core philosophy: ergonomics over performance. Macros hide boilerplate. Everything
integrates cleanly with tokio and cargo-nextest.
Status: all 11 crates implemented, tested, and
cargo publish --dry-runready. Not yet published to crates.io.
Crates
| Crate | Purpose |
|---|---|
tpt-async-mock | Type-safe mocking for async fn in traits |
tpt-snapshot | Snapshot runtime: assert_snapshot!, diffing, UPDATE_SNAPSHOTS=1 workflow |
tpt-snapshot-derive | #[derive(Snapshot)] for structs/enums |
tpt-fixture-loader | Declarative JSON/YAML/SQL test fixtures |
tpt-testcontainers-ext | Pre-configured testcontainers for modern DBs |
tpt-ci-env-helpers | CI detection, sharding, JUnit XML output |
tpt-property-gen | Domain-specific proptest generators |
tpt-temp-env-async | Safe env var mutation in parallel async tests |
tpt-assert-json-path | Fluent assertions for nested JSON |
tpt-bench-compare | Compare Criterion benchmarks across branches |
tpt-test-log-macro | Capture tracing logs, dump only on failure |
Workspace conventions
- Edition 2021, MSRV 1.75 (checked in CI).
MIT OR Apache-2.0dual license across every crate.- Minimal default features; heavier dependencies (async runtimes, serde, JUnit output, etc.) are opt-in via feature flags.
- Every crate must pass
cargo publish --dry-runbefore being marked release-ready.
Development
cargo build --workspace --all-features
cargo test --workspace --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Changelog
See CHANGELOG.md for the workspace-level changelog, or per-crate
CHANGELOG.md files for crate-specific history.