Skip to content

Commit dce67db

Browse files
committed
test(cli/rustup-mode): test auto-installation on to-be-deprecated subcommand
1 parent 4e5b12c commit dce67db

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/suite/cli_misc.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,3 +1795,27 @@ info: you may opt out with `RUSTUP_AUTO_INSTALL=0` or `rustup set auto-install d
17951795
"#]])
17961796
.is_ok();
17971797
}
1798+
1799+
#[tokio::test]
1800+
async fn warn_auto_install_on_rustup_deprecated() {
1801+
let cx = CliTestContext::new(Scenario::SimpleV2).await;
1802+
cx.config
1803+
.expect_with_env(
1804+
["rustup", "component", "list"],
1805+
[("RUSTUP_TOOLCHAIN", "stable"), ("RUSTUP_AUTO_INSTALL", "1")],
1806+
)
1807+
.await
1808+
.with_stdout(snapbox::str![[r#"
1809+
...
1810+
rustc-[HOST_TUPLE] (installed)
1811+
...
1812+
"#]])
1813+
.with_stderr(snapbox::str![[r#"
1814+
...
1815+
warn: the missing active toolchain `stable-[HOST_TUPLE]` has been auto-installed
1816+
warn: this might cause rustup commands to take longer time to finish than expected
1817+
info: you may opt out with `RUSTUP_AUTO_INSTALL=0` or `rustup set auto-install disable`
1818+
1819+
"#]])
1820+
.is_ok();
1821+
}

0 commit comments

Comments
 (0)