Closed sivadeilra closed 2 weeks ago
Should we be seeing a reduction here? https://github.com/microsoft/windows-rs/actions/workflows/test.yml
Should we be seeing a reduction here? https://github.com/microsoft/windows-rs/actions/workflows/test.yml
I certainly see a reduction locally.
Can you illustrate? I just don't see cargo test
doing much for the windows
crate unless you explicitly add --all-features
.
Can you illustrate? I just don't see
cargo test
doing much for thewindows
crate unless you explicitly add--all-features
.
What I see happening is that we spend a bunch of time compiling the windows
crate in test mode, even though it doesn't contain any tests. Then we "run" it and of course that takes no time, but we spent a long time compiling a useless executable.
I see this happening when I run cargo test
from the repo root. When you run cargo test
directly on the windows
crate you won't see it because no features are activated.
Ah, strangely this affects 'cargo test' but not 'cargo test --all' which is what I've trained myself to do. 🤷♂️
This PR improves cycle time for running
cargo test --all
.The
windows
andwindows-sys
crates do not contain unit tests or doc tests. Cargo doesn't know that, so it compiles these two very large crates in the#[cfg(test)]
mode and wastes time scanning for doc tests.This PR simply disables unit tests and doc tests in both of these crates. This saves a significant amount of time in running tests.