-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[WIP] Combine run-pass tests into a single crate #49142
Conversation
31ccebb
to
f646fc3
Compare
9f17513
to
6d7c17b
Compare
cc @rust-lang/compiler |
To future contributors, when should BTW I think the same strategy could be applied to doc tests. |
I'm personally not totally convinced we should do this, we did this a long time ago and it became untenable quickly as tests were never written for such a compilation and it would cause conflicts on various tests. Even here, for example, there's a lot of tests tagged with The wins here are nice but seem modest enough that it's not necessarily worth the increased friction in the test suite and maintenance on our end |
Hmm. This combines run-pass tests eagerly unless we annotate them with If we are going to do this, why would we not do it locally? |
I am curious to why it didn't work out previously. Do you remember some concrete problems? We could infer
100% faster tests is not a modest gain. Incremental compilation will reduce the time spent in compilation making testing the overall bottleneck, so it is important to get faster tests. On AppVeyor, 2/3 of the time is spent on testing. |
We discussed this in the @rust-lang/compiler meeting. It seems like the gains on tests are potentially substantial, if @Zoxc's numbers are representative. On the other hand, this involves a fair amount of complexity in the compiler itself (changes to feature gating system etc), and causes our testing code to stray further from the "real thing" that users will use. Some concerns that were raised:
|
Just for reference, while discussing this on IRC I did some analysis on splitting tests based on the feature flags they use (grouping tests with the same set of feature flags).
I personally think grouping based on the sets of features the tests are using (without an explicit blacklist) is better than grouping as much tests as possible together with all the feature flags available. |
This was way way long ago (like years before 1.0) when we did this, so my memory is a little hazy of this. If I recall correctly though, some issues were:
Some of these are solved with the strategy taken here, compiler support. That being said I don't think the pros outweigh the cons here, we already have a systemic problem of "my PR fails on CI but not locally" and by changing the testing strategy on CI further it inevitably increases that gap and continues to make tests harder and harder to write. |
That makes a lot of sense, and would certainly be less intrusive. |
338d469
to
d6c335e
Compare
☔ The latest upstream changes (presumably #49308) made this pull request unmergeable. Please resolve the merge conflicts. |
b286ae3
to
15a2f7e
Compare
ab20fff
to
563e8ca
Compare
I've made some changes. I now group tests by features and run all tests with the same feature set together and no longer rely on |
☔ The latest upstream changes (presumably #49337) made this pull request unmergeable. Please resolve the merge conflicts. |
I've added a whitelists of attributes allowed in a combined tests to catch attributes which could have a crate-level effect. |
Ping from triage, @Zoxc ! Looks like you have failing tests; will you have time to address them sometime soon? |
☔ The latest upstream changes (presumably #49252) made this pull request unmergeable. Please resolve the merge conflicts. |
These changes definitely seem to be going in the right direction, from my POV. I'm much happier with "asserting" that things are equal vs changing the behavior... |
I'm personally still against changing the tests in such a blanket fashion. I do agree that this will result in a faster test suite, but the wins here are only a handful of minutes. I feel that the tradeoff isn't worth it with respect to the amount of new code to maintain here and the possible impact this can have on the test suite. |
This also applies the same strategy for documentation examples in rustdoc. Using it there seems less risky as language edge cases aren't being tested. The test suite seems to spend a lot of time building those examples. I don't have any numbers for that yet though. Even if we don't end up enabling this for run-pass/compiletest, I'd still like the code for it to land as this makes it much easier to change compiletest to compile multiple test in a single rustc process, once rustc gets proper support for that. |
It's true yeah that rustdoc may be a better target here, but those are also notoriously flaky tests which are very difficult to tweak how they're generated. That means we'd for sure want it off by default to start with and may want to just take it slow on enabling it for CI builds. |
Ping from triage @Zoxc! What's the status of this PR? |
1 similar comment
Ping from triage @Zoxc! What's the status of this PR? |
This PR needs some more work. I'll just close it for now. |
This combines run-pass tests into larger crates.
Some timings: