Skip to content

Commit d78990b

Browse files
committed
Add a way to disable all nightly tests
One thing I'm realizing now is that we test a number of nightly features of Cargo/rustc, but if they change in rustc then because rust-lang/rust's CI run's Cargo's tests it could prevent those changes from landing! The purpose of running Cargo's tests in CI in rust-lang/rust is to ensure that Cargo generally works, but there's no need to test the nightly features as that's Cargo's job. As a result this adds an environment variable that will be set from rust-lang/rust's CI which will disable these tests.
1 parent e3563db commit d78990b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/testsuite/support/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,9 @@ pub fn rustc_host() -> String {
16501650
}
16511651

16521652
pub fn is_nightly() -> bool {
1653-
RUSTC.with(|r| r.verbose_version.contains("-nightly") || r.verbose_version.contains("-dev"))
1653+
env::var("CARGO_TEST_DIABLE_NIGHTLY").is_err()
1654+
&& RUSTC
1655+
.with(|r| r.verbose_version.contains("-nightly") || r.verbose_version.contains("-dev"))
16541656
}
16551657

16561658
pub fn process<T: AsRef<OsStr>>(t: T) -> cargo::util::ProcessBuilder {

0 commit comments

Comments
 (0)