I have a multi-workspace cargo project:
cli/
server/
test/
Cargo.toml
In parent Cargo.toml
[workspace]
members = [
"server",
"cli",
"tests",
]
resolver = "1"
In test
workspace a have a bunch of integration tests which are depends on build of cli
crate. So, I just want to run cargo test
to run all my tests that are depends on builded cli
executable file. But now it’s fails with:
test tests::should_output_help ... FAILED
failures:
---- tests::should_output_help stdout ----
Error: Cause: Cargo command not found: /Users/l3r8y/code/fakehub/target/debug/cli
But if i’ll run cargo build
before tests everything would be fine. So question is – Is it possible to make cargo test
build cli
create and run tests only after cli
has been built?