End-to-end testing your Rust backend
summary
Claims concrete results: isolated Postgres database cloning and transaction-wrapping approaches cut interference, running about 2,000 tests in 30 seconds on a modern desktop; disk tempfs and relaxed durability settings speed setup. Tests use a small, application-specific request Builder to hide boilerplate and deserialize responses directly, and the rstest crate to parametrize one test across many endpoints. Example code shows cloning, transaction injection, and builder implementations that actually run and simplify end-to-end REST API tests.
AI-written summary · about
chapters (13)
- 0:00Start
- 0:58Testing Backends in Rust
- 1:35End-to-End Testing Tradeoffs
- 3:49Speed matters
- 6:05Popular Approaches
- 7:53First Approach: Transactions
- 10:17Second Technique: Cloning Databases
- 11:36Tuning the Database
- 14:00Example of a Test
- 18:18Creating a Request Builder
- 20:28Implementing a Method
- 23:22Request Builder Examples
- 28:44Summary
related talks
28mBuild bigger in less time: code testing beyond the basics
15mTesting My Patience: An Exploration of Testing in Rust
23mTips for Writing a Web Server and Beyond
32mTesting strategies and pattern for efficient TDD in Rust
24mMissing Testing Features in Rust
25mWTF, Rust for Web Development??
20mRust as foundation in a polyglot development environment
21mA Tour of Empirical Verification in Rust
