-
Notifications
You must be signed in to change notification settings - Fork 2.6k
skip test if not nightly; fix for #5648 #5652
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
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
tests/testsuite/resolve.rs
Outdated
@@ -354,6 +354,12 @@ fn test_resolving_minimum_version_with_transitive_deps() { | |||
pkg!("bar" => [dep_req("util", ">=1.0.1")]), | |||
]); | |||
|
|||
if !nightly_features_allowed() { |
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 feel like I've seen other cargo tests use something like is_nightly
already, perhaps grep for #![feature
?
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.
good call switched to is_nightly
I'm wondering if all the |
probably, update on the way. |
Question: why these tests pass Cargo's own CI, which uses stable, in the first place? |
@matklad I don't fully understand ether, the best explanation so far is #5648 (comment) |
Hm I agree with @matklad that it's a little worrisome how these tests are passing today. Could we perhaps:
That way we should proactively catch this and it's clear which tests are opting in to nightly? |
@alexcrichton I do not, at this time, know this stuff well enough to make that happen. When we have a plan of action, someone could give mentoring instructions, or just submit an alternative PR. I made this PR as a quick fix, I was unclear if this was a crises (like blocking the 1.27 release.) that needed a fix before the knowledgeable people returned. |
@Eh2406 oh no worries! I can try to help guide you through this if you want as well. It actually looks like we already do this for everything using |
Yes I believe that is true. I.E. "integration test" that use |
Indeed yeah, I'd imagine that a method could be added to |
Can we just call |
One idea to ensure everything tests on stable by default is to change this line to "stable": cargo/src/cargo/core/features.rs Line 368 in 9e4845e
I tested it, and only the tests fixed in this PR fail. That way, unittests that need nightly will be be explicit (either by overriding the channel or just ignoring the test). |
@ehuss dose that means that cargo built from source does not allow nightly things? |
Ah, yea, that probably would be annoying. Nevermind. 😛 |
I tried |
Also this is buggy as |
Could a global variable be added to |
@alexcrichton I don't quite understand your suggestion. Witch is ok, you could elaborate or make an alternative PR, whichever is easier for you. The design constraints I see are:
So I think you are suggesting a global mutable variable, that defaults to "dev" (so we get 3) and can be changed to "stable" using the helper function |
Ah yes those constraints are indeed correct! I think my idea wasn't quite what we wanted but I whipped this up -- https://gist.github.com/alexcrichton/9c878e9d1c81a1956af9323657dacf2b -- which is somewhat similar. I think that should solve everything? |
Clever! |
50906f1
to
6860dbc
Compare
6860dbc
to
75bb190
Compare
Updated to match your patch, + some additional comments. |
@bors: r+ Thanks so much! |
📌 Commit 75bb190 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
closes #5648
The alternative was to use
set_var
to emulatemasquerade_as_nightly_cargo
but we worried that it would not get unset correctly. Although I think each test is its own process, so it should work.