Skip to content

Commit 734de17

Browse files
committed
test(cli_v2): test error when missing many components on install
1 parent 4352bec commit 734de17

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/suite/cli_v2.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ note: sometimes not all components are available in any given nightly
19861986
}
19871987

19881988
#[tokio::test]
1989-
async fn add_missing_component_toolchain() {
1989+
async fn add_toolchain_with_missing_component() {
19901990
let cx = CliTestContext::new(Scenario::SimpleV2).await;
19911991
make_component_unavailable(&cx.config, "rust-std", this_host_triple());
19921992
cx.config
@@ -2009,6 +2009,32 @@ help: cargo +nightly-2018-12-27 build
20092009
.is_err();
20102010
}
20112011

2012+
#[tokio::test]
2013+
async fn add_toolchain_with_missing_components() {
2014+
let cx = CliTestContext::new(Scenario::SimpleV2).await;
2015+
for comp in &["rust-std", "cargo"] {
2016+
make_component_unavailable(&cx.config, comp, this_host_triple());
2017+
}
2018+
cx.config
2019+
.expect(["rustup", "toolchain", "add", "nightly"])
2020+
.await
2021+
.with_stderr(snapbox::str![[r#"
2022+
...
2023+
error: some components are unavailable for download for channel 'nightly': 'cargo' for target '[HOST_TRIPLE]', 'rust-std' for target '[HOST_TRIPLE]'
2024+
note: sometimes not all components are available in any given nightly
2025+
help: if you don't need these components, you could try a minimal installation with:
2026+
help: rustup toolchain add nightly --profile minimal
2027+
help: if you require these components, please install and use the latest successfully built version,
2028+
help: which you can find at <https://rust-lang.github.io/rustup-components-history>
2029+
help: after determining the correct date, install it with a command such as:
2030+
help: rustup toolchain install nightly-2018-12-27
2031+
help: then you can use the toolchain with commands such as:
2032+
help: cargo +nightly-2018-12-27 build
2033+
2034+
"#]])
2035+
.is_err();
2036+
}
2037+
20122038
#[tokio::test]
20132039
async fn update_removed_component_toolchain() {
20142040
let cx = CliTestContext::new(Scenario::RemovedRls).await;

0 commit comments

Comments
 (0)