Delightful integration tests in Rust
15 points by alexpusch
15 points by alexpusch
I wasn't struck by the lack of setup and cleaup hooks (writing a small RAII object is pretty easy) but rather the inability to create tests from fixtures without resorting to procmacros.
The one that I really wish for right now is some way of "tagging" tests without just having special conventions in the naming scheme.
I wish it was easier to use plain old processes instead of containers. There are a couple of projects that automate fetching and using PostgreSQL binaries. Likely you can use nixpkgs or devenv too.
Delightful indeed. :)
At the moment, the project I'm focused on has a roadmap intended to eventually out-miniserve miniserve in being self-contained and easy to deploy (i.e. being so self-contained and easy for a novice to use in place of a cloud provider that it supports stuff like using UPnP to forward ports and "What is my IP?" services to construct shareable URLs) but I look forward to exploring testcontainers-rs the next time I'm working on something more involved.
(Probably with #[ignore] on the container tests and --include-ignored so cargo test remains fast and I can use something like just integration to run them, similar to how I've historically marked my rustdoc code examples no_run because doctests were such a drag on the edit-compile-run test cycle otherwise.)
fn ready_conditions(&self) -> Vec<WaitFor>;
TIL, super useful!