-
Notifications
You must be signed in to change notification settings - Fork 830
RFC: Simplify version handling of UI tests. #3171
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
Conversation
9eff940
to
3e40fa5
Compare
bors try |
tryBuild succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
bors try |
tryBuild succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Can you clarify where the current tests broke? It was a best effort but I was hoping that by gating tests on each version in the way it was currently done it should be the case that when a test output changed it would be bumped to run only on that rust version or newer. The effect hopefully being that older intermediate versions would only run tests which that version produced the same output as current stable. |
I ran the tests using 1.63 and immediately, meaning on
I suspect we failed to do this at some point in the past when we updated the expected error outputs to match a new stable release. These test cases would have had to be moved to a later Personally, I don't think the effort to keep this aligned is worth it: We do not test these intermediate versions in the CI. (Which is also why we did not notice them breaking.) Even for MSRV and nightly, it seems enough to check that these test cases fail to build as expected. The detailed error message could then just be kept in sync with the current stable release and that would be it. Hence the change proposed here. (With this change, we could also drop the dev dependency on |
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.
Ah right. That makes sense and I'm in favour of simplification.
So the one concern I have is for system package distributors, who I think may sometimes run cargo test
as part of their package build / distribution? If that's the case I suspect they use the distro's rust, which probably isn't latest stable.
That said, as you note, it's already broken. I suppose that if we go this route and only support the UI tests on latest stable, we can perhaps just recommend any distro packagers who hit this just ignore the UI tests.
One idea I see to fix this is to just not ship While this may appear a bit heavy-handed, alternatives like environment variables or Cargo features seem to loose out on discoverability and brittleness. |
That sounds like a very reasonable idea, as long as we don't have other references to those files which might otherwise break the distributed crate. I suppose some vendors might be using the GitHub archive, they can always strip or ignore the UI tests themselves. |
a2e25c0
to
f9a31b5
Compare
I excluded the UI tests from the package for crates.io and converted the nightly-related UI tests into doc tests which is actually nice since it gives a bit more context. Please have another look. |
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.
A really nice improvement! Just one comment motivated by our new docs, which we might want to spin off into a separate discussion...
91a730b
to
7dd9d42
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.
Looks great, sorry for the delayed approval!
bors r+
Merge conflict. |
Due to checking in error outputs these tests only work reliably on stable and not on intermediate version between our MSRV (currently 1.48) and the current stable version. Hence this simplifies things to run only MSRV-compatible tests for the MSRV builds, anything else for stable builds except for those tests which require the nightly feature, i.e. the `Ungil` being distinct from the `Send` trait. Finally, `not_send3` is disabled when using the nightly feature since while `Rc` is not send, it also not GIL-bound and hence can be passed into `allow_threads` as it does not actually spawn a new thread.
…rk reliably using the current stable version Rust, e.g. in our CI.
… the changing error outputs of nightly in any case.
… dependencies for the docs.
… and mention the available solution.
7dd9d42
to
0f628c9
Compare
bors retry |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Due to checking in error outputs these tests only work reliably on stable and not on intermediate version between our MSRV (currently 1.48) and the current stable version.
Hence this simplifies things to run only MSRV-compatible tests for the MSRV builds, anything else for stable builds except for those tests which require the nightly feature, i.e. the
Ungil
being distinct from theSend
trait.Finally,
not_send3
is disabled when using the nightly feature since whileRc
is not send, it also not GIL-bound and hence can be passed intoallow_threads
as it does not actually spawn a new thread.