I’m currently writing tests for Sudograph, using Rust’s built-in testing capabilities (
cargo test and such) and proptest. I spin up a local replica and execute my tests as
update calls into canisters. That works very well for integration tests, as my tests go through the entire motions of creating query and update calls and validating the responses.
But it’s very slow, even if I use
--no-artificial-delay, compared to the speed my tests could move at if they were running from within the canister. Instead of performing http requests to call the canister methods, it would be nice if I could run tests from within the canister that could call the methods directly.
How should we go about testing canister code without the overhead of network requests to perform query and update calls?