Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive tests take too long to compile and run #1582

Open
djkoloski opened this issue Aug 9, 2024 · 1 comment
Open

Derive tests take too long to compile and run #1582

djkoloski opened this issue Aug 9, 2024 · 1 comment

Comments

@djkoloski
Copy link
Member

Running cargo clean && cargo test -p zerocopy-derive takes upwards of a 1m20s on my relatively beefy machine. Compiling enum_from_bytes alone makes up 89% of that time - a full 1m11s. By comparison, cargo clean && cargo test -p zerocopy only takes 12s. Additionally, actually compiling zerocopy-derive only takes around 2.3s.

General slowness also makes rust-analyzer lag pretty far behind and compete over the lockfile with any command-line operations. This results in a pretty miserable development experience.

@joshlf
Copy link
Member

joshlf commented Aug 10, 2024

Is there any way to get cargo test to skip compiling a test by default? Analogous to #[ignore], but for compilation rather than for running the test? If so, we could compile and run enum_from_bytes in CI but disable it by default for local development.

One hacky way of accomplishing that would be to put a #![cfg(zerocopy_compile_expensive_tests)] at the top of the file. I worry that it'd be yet one more thing that we have to keep track of wiring through our CI code, though. It'd be very easy to delete that at some point and not notice that we're silently ignoring that test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants