-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Filter and build integration tests needed only #8282
Copy link
Copy link
Closed
Labels
A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy
Metadata
Metadata
Assignees
Labels
A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyExperience: Easy
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the problem you are trying to solve
There is a project with 20+ integration tests, it takes like few minutes to build all of them. Even with a small change in one of the tests file and I wanted to just run one of the tests file, I did
cargo tests part_abut it still compiles everything again.The solution right now,
rm tests/*git restore tests/part_a.rscargo test part_a, try rebuildinggit restore src/dep.rs, add some dependencies neededEssentially, this will also remove the issue of clogging the screen with 0 tests run and the need to scroll up multiple times to search for the tests run #4324.
Describe the solution you'd like
Search for the functions used in the filter (
cargo test <filter>), build and run only those files needed. Something like ripgrep for function name, but this requires cargo to include the dependencies too.This provides 2 benefits, reducing the need to build unneeded files and prevent clogging the screen by running file without tests matching the filter.
Notes
I would like to take on this issue if the complexity is not high or if there are people willing to mentor.