-
Notifications
You must be signed in to change notification settings - Fork 252
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
Dev quality-of-life improvements (better test backtraces in CI and locally; faster test builds; RUST_BACKTRACE=1
by default)
#1603
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1603 +/- ##
=======================================
Coverage 56.30% 56.30%
=======================================
Files 148 148
Lines 19062 19062
=======================================
+ Hits 10732 10733 +1
+ Misses 8330 8329 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
…test profile to compile with optimizations by default, but keep full debug info. This differs from the release profile in the following ways: - it does not set `lto = true`, which increases compile times without substantially speeding up tests; - it does not set `codegen-units = 1`, which increases compile times and is only useful to improve determinism of release builds; - it does not set `panic = 'abort'`, which is in any case ignored for tests. After this PR, to get results as close as possible to a release build, use `cargo test --release`. To speed up compilation and avoid optimizations potentially resulting in lower-quality debug info, use `cargo test --profile=dev`. Times on my machine starting from `cargo clean` for each run: * `cargo test --all-targets --all-features`: * 484s (354s build, 130s tests) * `cargo test --release --all-targets --all-features`: * 541s (415s build, 126s tests) * `cargo test --profile=dev --all-targets --all-features`: * 1709s (146s build, 1563s tests) * this might still be faster when running individual tests. Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
(instead of only in CI), so that there is no need to set it manually. You can override this by setting `RUST_BACKTRACE=0`, or `RUST_BACKTRACE=full` for a full backtrace. Signed-off-by: Daira-Emma Hopwood <[email protected]>
63366c2
to
5672b30
Compare
See #1604 (comment) for an example backtrace from CI. |
RUST_BACKTRACE=1
by default; remove unused GitLab CI config)
RUST_BACKTRACE=1
by default; remove unused GitLab CI config)RUST_BACKTRACE=1
by default)
This significantly improves CI latency for tests, by about a third (3 minutes). This is due to the faster build (no LTO and no Before (#1580): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK, looks great!
Post-hoc ACK. |
.gitlab-ci.yml
which is not used (and probably bitrotted).cargo test --release
, and does not require you to remember to pass--release
(you still can, and the meaning of that has not changed).--profile=dev
to get more precise stack traces in case information is optimized out. Remember to only run the desired subset of tests in that case (as before).--release
.cargo
will now useRUST_BACKTRACE=1
by default in this workspace, so that there is no need to set it manually.In other words,
cargo test
now just does the Right Thing 🎉 (you may still have to set features).fixes #1602