I have a project composed from various sub-crates. If I follow a
cargo test --all run by doing a
cargo test in each crate directory I notice that cargo needs to recompile a lot of dependencies. These were presumably compiled in the previous
cargo test --all run. It seems like build artifacts aren't being shared.
Is this expected behaviour? or is it likely my project's build configuration etc.
For some extra context, this creates an issue for CI builds as
cargo test --all is very slow to build in my project. I'd like to run tests on a per crate basis but the cost of recompiling each crate in the end vastly out weights the caching given by
cargo test --all