Skip to content

Commit ca17faf

Browse files
committed
test: detach snapshots from component installation order
1 parent 00e7967 commit ca17faf

File tree

6 files changed

+213
-174
lines changed

6 files changed

+213
-174
lines changed

tests/suite/cli_exact.rs

Lines changed: 60 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@ async fn update_once() {
2222
.with_stderr(snapbox::str![[r#"
2323
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
2424
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
25-
info: downloading component 'cargo'
26-
info: downloading component 'rust-docs'
27-
info: downloading component 'rust-std'
28-
info: downloading component 'rustc'
29-
info: installing component 'cargo'
30-
info: installing component 'rust-docs'
31-
info: installing component 'rust-std'
32-
info: installing component 'rustc'
25+
info: downloading component[..]
26+
...
3327
info: default toolchain set to 'nightly-[HOST_TRIPLE]'
3428
29+
"#]]);
30+
cx.config
31+
.expect(["rustup", "+nightly", "component", "list", "--installed"])
32+
.await
33+
.is_ok()
34+
.with_stdout(snapbox::str![[r#"
35+
cargo-[HOST_TRIPLE]
36+
rust-docs-[HOST_TRIPLE]
37+
rust-std-[HOST_TRIPLE]
38+
rustc-[HOST_TRIPLE]
39+
3540
"#]]);
3641
}
3742

@@ -64,14 +69,18 @@ rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION]
6469
.with_stderr(snapbox::str![[r#"
6570
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
6671
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
67-
info: downloading component 'cargo'
68-
info: downloading component 'rust-docs'
69-
info: downloading component 'rust-std'
70-
info: downloading component 'rustc'
71-
info: installing component 'cargo'
72-
info: installing component 'rust-docs'
73-
info: installing component 'rust-std'
74-
info: installing component 'rustc'
72+
info: downloading component[..]
73+
...
74+
"#]]);
75+
cx.config
76+
.expect(["rustup", "+nightly", "component", "list", "--installed"])
77+
.await
78+
.is_ok()
79+
.with_stdout(snapbox::str![[r#"
80+
cargo-[HOST_TRIPLE]
81+
rust-docs-[HOST_TRIPLE]
82+
rust-std-[HOST_TRIPLE]
83+
rustc-[HOST_TRIPLE]
7584
7685
"#]]);
7786
}
@@ -103,17 +112,22 @@ async fn update_once_and_self_update() {
103112
.with_stderr(snapbox::str![[r#"
104113
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
105114
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
106-
info: downloading component 'cargo'
107-
info: downloading component 'rust-docs'
108-
info: downloading component 'rust-std'
109-
info: downloading component 'rustc'
110-
info: installing component 'cargo'
111-
info: installing component 'rust-docs'
112-
info: installing component 'rust-std'
113-
info: installing component 'rustc'
115+
info: downloading component[..]
116+
...
114117
info: checking for self-update (current version: [CURRENT_VERSION])
115118
info: downloading self-update (new version: [TEST_VERSION])
116119
120+
"#]]);
121+
cx.config
122+
.expect(["rustup", "+nightly", "component", "list", "--installed"])
123+
.await
124+
.is_ok()
125+
.with_stdout(snapbox::str![[r#"
126+
cargo-[HOST_TRIPLE]
127+
rust-docs-[HOST_TRIPLE]
128+
rust-std-[HOST_TRIPLE]
129+
rustc-[HOST_TRIPLE]
130+
117131
"#]]);
118132
}
119133

@@ -309,16 +323,21 @@ async fn default() {
309323
.with_stderr(snapbox::str![[r#"
310324
info: syncing channel updates for 'nightly-[HOST_TRIPLE]'
311325
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
312-
info: downloading component 'cargo'
313-
info: downloading component 'rust-docs'
314-
info: downloading component 'rust-std'
315-
info: downloading component 'rustc'
316-
info: installing component 'cargo'
317-
info: installing component 'rust-docs'
318-
info: installing component 'rust-std'
319-
info: installing component 'rustc'
326+
info: downloading component[..]
327+
...
320328
info: default toolchain set to 'nightly-[HOST_TRIPLE]'
321329
330+
"#]]);
331+
cx.config
332+
.expect(["rustup", "component", "list", "--installed"])
333+
.await
334+
.is_ok()
335+
.with_stdout(snapbox::str![[r#"
336+
cargo-[HOST_TRIPLE]
337+
rust-docs-[HOST_TRIPLE]
338+
rust-std-[HOST_TRIPLE]
339+
rustc-[HOST_TRIPLE]
340+
322341
"#]]);
323342
}
324343

@@ -738,11 +757,15 @@ async fn cross_install_indicates_target() {
738757
.expect(["rustup", "target", "add", CROSS_ARCH1])
739758
.await
740759
.is_ok()
741-
.with_stdout(snapbox::str![[""]])
742-
.with_stderr(snapbox::str![[r#"
743-
info: downloading component 'rust-std' for '[CROSS_ARCH_I]'
744-
info: installing component 'rust-std' for '[CROSS_ARCH_I]'
745-
760+
.with_stdout(snapbox::str![[""]]);
761+
cx.config
762+
.expect(["rustup", "component", "list", "--installed"])
763+
.await
764+
.is_ok()
765+
.with_stdout(snapbox::str![[r#"
766+
...
767+
rust-std-[CROSS_ARCH_I]
768+
...
746769
"#]]);
747770
}
748771

tests/suite/cli_misc.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,18 @@ async fn rustup_run_install() {
608608
"--version",
609609
])
610610
.await
611-
.with_stderr(snapbox::str![[r#"
612-
...
613-
info: installing component 'rustc'
614-
...
615-
"#]])
616611
.is_ok();
612+
cx.config
613+
.expect(["rustup", "+nightly", "component", "list", "--installed"])
614+
.await
615+
.is_ok()
616+
.with_stdout(snapbox::str![[r#"
617+
cargo-[HOST_TRIPLE]
618+
rust-docs-[HOST_TRIPLE]
619+
rust-std-[HOST_TRIPLE]
620+
rustc-[HOST_TRIPLE]
621+
622+
"#]]);
617623
}
618624

619625
#[tokio::test]

0 commit comments

Comments
 (0)