-
Notifications
You must be signed in to change notification settings - Fork 381
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
compile integration tests as a single binary #2914
Conversation
3a88e64
to
5daccac
Compare
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.
While this is a bit adhoc, I like the end result.
@arxanas any thoughts?
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.
Wow, this is fast 🚀. I might no longer have to be paranoid about linking speed and all the ways phases of the moon that can affect it. LGTM, but I'll let others officially approve.
Aside: I wish Rust more obviously encouraged this style, or defaulted to building one binary for the tests.
Can you compare the resulting runtimes for running the whole test suite and running a single test? The improved compilation times are admirable, but if it turns out that the full test suite :: 5m -> 4m but incremental tests :: 2s -> 4s then it might not be worth it. Ideally I would have incremental rebuild+test times be <1s. When developing jj, I extensively relied on re-running individual tests repeatedly, so that feedback loop is very important to me. Others might feel differently about those trade-offs. |
The benchmark in the commit message is |
I also unscientifically tried I found another minor downside: the fish shell has completions for |
Regarding |
cargo does not do content-addressed hashing, no. you can see this if you set CARGO_LOG=info:
sure; but the times are small enough i don't think times on my computer will be comparable to yours, i'd recommend running this on your own machine to see what the times are. before this change:
after this change:
so only about half a second of regression, from 3.5 to 4 seconds. (using |
yeah, this is unfortunate. i don't know a way to fix this upstream in fish; it would have to parse the |
it takes about 13.5 seconds for me to run the tests with |
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.
I'm giving my approval now anyway. It sounds like most people are for this change. We can always roll it back if it turns out we missed something. Thanks again, jyn!
I think Martin will cut a release in the next couple of days. I'm likely being overly cautious, but perhaps we can delay merging this until the release, just in case? P.S. The tests are failing because a few new test files were added in the last week. |
It doesn't seem that this can break the binaries, so what's your concern? If it breaks the CI actions, I'd rather learn that tomorrow than in a month. |
this greatly speeds up the time to run all tests, at the cost of slightly larger recompile times for individual tests. this unfortunately adds the requirement that all tests are listed in `runner.rs` for the crate. to avoid forgetting, i've added a new test that ensures the directory is in sync with the file. ## benchmarks before this change, recompiling all tests took 32-50 seconds and running a single test took 3.5 seconds: ``` ; hyperfine 'touch lib/src/lib.rs && cargo t --test test_working_copy' Time (mean ± σ): 3.543 s ± 0.168 s [User: 2.597 s, System: 1.262 s] Range (min … max): 3.400 s … 3.847 s 10 runs ``` after this change, recompiling all tests take 4 seconds: ``` ; hyperfine 'touch lib/src/lib.rs ; cargo t --test runner --no-run' Time (mean ± σ): 4.055 s ± 0.123 s [User: 3.591 s, System: 1.593 s] Range (min … max): 3.804 s … 4.159 s 10 runs ``` and running a single test takes about the same: ``` ; hyperfine 'touch lib/src/lib.rs && cargo t --test runner -- test_working_copy' Time (mean ± σ): 4.129 s ± 0.120 s [User: 3.636 s, System: 1.593 s] Range (min … max): 3.933 s … 4.346 s 10 runs ``` about 1.4 seconds of that is the time for the runner, of which .4 is the time for the linker. so there may be room for further improving the times.
OK, this is definitely up to Martin. (I was vaguely worried about the CI) Please feel free to merge, and thank you again! |
closes #2912
Checklist
If applicable:
CHANGELOG.md