tpt-dx-testing

Rust

Ergonomic 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.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust100.0%
README

tpt-dx-testing

CI License: MIT OR Apache-2.0 Rust 1.75+

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-run ready. Not yet published to crates.io.

Crates

CratePurpose
tpt-async-mockType-safe mocking for async fn in traits
tpt-snapshotSnapshot runtime: assert_snapshot!, diffing, UPDATE_SNAPSHOTS=1 workflow
tpt-snapshot-derive#[derive(Snapshot)] for structs/enums
tpt-fixture-loaderDeclarative JSON/YAML/SQL test fixtures
tpt-testcontainers-extPre-configured testcontainers for modern DBs
tpt-ci-env-helpersCI detection, sharding, JUnit XML output
tpt-property-genDomain-specific proptest generators
tpt-temp-env-asyncSafe env var mutation in parallel async tests
tpt-assert-json-pathFluent assertions for nested JSON
tpt-bench-compareCompare Criterion benchmarks across branches
tpt-test-log-macroCapture tracing logs, dump only on failure

Workspace conventions

  • Edition 2021, MSRV 1.75 (checked in CI).
  • MIT OR Apache-2.0 dual 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-run before 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.