Dev quality-of-life improvements (better test backtraces in CI and locally; faster test builds; RUST_BACKTRACE=1 by default)#1603
Merged
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 <daira@jacaranda.org>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
…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 <daira@jacaranda.org>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
(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 <daira@jacaranda.org>
63366c2 to
5672b30
Compare
Contributor
Author
|
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)
Contributor
Author
|
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): |
Contributor
|
Post-hoc ACK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


.gitlab-ci.ymlwhich 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=devto 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.cargowill now useRUST_BACKTRACE=1by default in this workspace, so that there is no need to set it manually.In other words,
cargo testnow just does the Right Thing 🎉 (you may still have to set features).fixes #1602