Skip to content

Tidy up the mock dist server #1998

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

Merged
merged 1 commit into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions tests/cli-exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ fn update() {
&["rustup", "update", "nightly", "--no-self-update"],
for_host!(
r"
nightly-{0} installed - 1.3.0 (hash-n-2)
nightly-{0} installed - 1.3.0 (hash-nightly-2)

"
),
for_host!(
r"info: syncing channel updates for 'nightly-{0}'
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
info: downloading component 'rustc'
info: downloading component 'cargo'
info: downloading component 'rust-std'
Expand All @@ -57,7 +57,7 @@ fn update_again() {
&["rustup", "update", "nightly", "--no-self-update"],
for_host!(
r"
nightly-{0} unchanged - 1.3.0 (hash-n-2)
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)

"
),
Expand All @@ -80,9 +80,9 @@ fn check_updates_none() {
config,
&["rustup", "check"],
for_host!(
r"stable-{0} - Up to date : 1.0.0 (hash-s-1)
beta-{0} - Up to date : 1.1.0 (hash-b-1)
nightly-{0} - Up to date : 1.2.0 (hash-n-1)
r"stable-{0} - Up to date : 1.0.0 (hash-stable-1.0.0)
beta-{0} - Up to date : 1.1.0 (hash-beta-1.1.0)
nightly-{0} - Up to date : 1.2.0 (hash-nightly-1)
"
),
);
Expand All @@ -101,9 +101,9 @@ fn check_updates_some() {
config,
&["rustup", "check"],
for_host!(
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
beta-{0} - Update available : 1.1.0 (hash-b-1) -> 1.2.0 (hash-b-2)
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
beta-{0} - Update available : 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0)
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
"
),
);
Expand All @@ -121,9 +121,9 @@ fn check_updates_with_update() {
config,
&["rustup", "check"],
for_host!(
r"stable-{0} - Up to date : 1.0.0 (hash-s-1)
beta-{0} - Up to date : 1.1.0 (hash-b-1)
nightly-{0} - Up to date : 1.2.0 (hash-n-1)
r"stable-{0} - Up to date : 1.0.0 (hash-stable-1.0.0)
beta-{0} - Up to date : 1.1.0 (hash-beta-1.1.0)
nightly-{0} - Up to date : 1.2.0 (hash-nightly-1)
"
),
);
Expand All @@ -132,9 +132,9 @@ nightly-{0} - Up to date : 1.2.0 (hash-n-1)
config,
&["rustup", "check"],
for_host!(
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
beta-{0} - Update available : 1.1.0 (hash-b-1) -> 1.2.0 (hash-b-2)
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
beta-{0} - Update available : 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0)
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
"
),
);
Expand All @@ -143,9 +143,9 @@ nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
config,
&["rustup", "check"],
for_host!(
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
beta-{0} - Up to date : 1.2.0 (hash-b-2)
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
beta-{0} - Up to date : 1.2.0 (hash-beta-1.2.0)
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
"
),
);
Expand All @@ -160,13 +160,13 @@ fn default() {
&["rustup", "default", "nightly"],
for_host!(
r"
nightly-{0} installed - 1.3.0 (hash-n-2)
nightly-{0} installed - 1.3.0 (hash-nightly-2)

"
),
for_host!(
r"info: syncing channel updates for 'nightly-{0}'
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
info: downloading component 'rustc'
info: downloading component 'cargo'
info: downloading component 'rust-std'
Expand All @@ -192,7 +192,7 @@ fn override_again() {
&["rustup", "override", "add", "nightly"],
for_host!(
r"
nightly-{} unchanged - 1.3.0 (hash-n-2)
nightly-{} unchanged - 1.3.0 (hash-nightly-2)

"
),
Expand Down Expand Up @@ -426,7 +426,7 @@ fn update_invalid_toolchain() {
&["rustup", "update", "nightly-2016-03-1"],
r"",
r"info: syncing channel updates for 'nightly-2016-03-1'
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
error: target '2016-03-1' not found in channel. Perhaps check https://forge.rust-lang.org/platform-support.html for available targets
",
);
Expand All @@ -441,7 +441,7 @@ fn default_invalid_toolchain() {
&["rustup", "default", "nightly-2016-03-1"],
r"",
r"info: syncing channel updates for 'nightly-2016-03-1'
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
error: target '2016-03-1' not found in channel. Perhaps check https://forge.rust-lang.org/platform-support.html for available targets
",
);
Expand Down
2 changes: 1 addition & 1 deletion tests/cli-inst-interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn blank_lines_around_stderr_log_output_install() {
3) Cancel installation
>

stable installed - 1.1.0 (hash-s-2)
stable installed - 1.1.0 (hash-stable-1.1.0)


Rust is installed now. Great!
Expand Down
28 changes: 14 additions & 14 deletions tests/cli-misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn update_all_no_update_whitespace() {
&["rustup", "update", "nightly", "--no-self-update"],
for_host!(
r"
nightly-{} installed - 1.3.0 (hash-n-2)
nightly-{} installed - 1.3.0 (hash-nightly-2)

"
),
Expand Down Expand Up @@ -197,7 +197,7 @@ fn multi_host_smoke_test() {
clitools::setup(Scenario::MultiHost, &|config| {
let toolchain = format!("nightly-{}", clitools::MULTI_ARCH1);
expect_ok(config, &["rustup", "default", &toolchain]);
expect_stdout_ok(config, &["rustc", "--version"], "xxxx-n-2"); // cross-host mocks have their own versions
expect_stdout_ok(config, &["rustc", "--version"], "xxxx-nightly-2"); // cross-host mocks have their own versions
});
}

Expand All @@ -219,13 +219,13 @@ fn custom_toolchain_cargo_fallback_proxy() {
expect_ok(config, &["rustup", "default", "mytoolchain"]);

expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
expect_stdout_ok(config, &["cargo", "--version"], "hash-s-2");
expect_stdout_ok(config, &["cargo", "--version"], "hash-stable-1.1.0");

expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
expect_stdout_ok(config, &["cargo", "--version"], "hash-b-2");
expect_stdout_ok(config, &["cargo", "--version"], "hash-beta-1.2.0");

expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_stdout_ok(config, &["cargo", "--version"], "hash-n-2");
expect_stdout_ok(config, &["cargo", "--version"], "hash-nightly-2");
});
}

Expand All @@ -250,21 +250,21 @@ fn custom_toolchain_cargo_fallback_run() {
expect_stdout_ok(
config,
&["rustup", "run", "mytoolchain", "cargo", "--version"],
"hash-s-2",
"hash-stable-1.1.0",
);

expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
expect_stdout_ok(
config,
&["rustup", "run", "mytoolchain", "cargo", "--version"],
"hash-b-2",
"hash-beta-1.2.0",
);

expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_stdout_ok(
config,
&["rustup", "run", "mytoolchain", "cargo", "--version"],
"hash-n-2",
"hash-nightly-2",
);
});
}
Expand Down Expand Up @@ -738,13 +738,13 @@ fn update_unavailable_rustc() {
set_current_dist_date(config, "2015-01-01");
expect_ok(config, &["rustup", "default", "nightly"]);

expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");

// latest nightly is unavailable
set_current_dist_date(config, "2015-01-02");
// update should do nothing
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
});
}

Expand All @@ -754,7 +754,7 @@ fn update_nightly_even_with_incompat() {
set_current_dist_date(config, "2019-09-12");
expect_ok(config, &["rustup", "default", "nightly"]);

expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
expect_ok(config, &["rustup", "component", "add", "rls"]);
expect_component_executable(config, "rls");

Expand All @@ -764,7 +764,7 @@ fn update_nightly_even_with_incompat() {
expect_component_executable(config, "rls");
// update should bring us to latest nightly that does
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-2");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-2");
expect_component_executable(config, "rls");
});
}
Expand All @@ -775,14 +775,14 @@ fn nightly_backtrack_skips_missing() {
set_current_dist_date(config, "2015-01-01");
expect_ok(config, &["rustup", "default", "nightly"]);

expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");

// nightly is missing on latest
set_current_dist_date(config, "2015-01-02");

// update should not change nightly, and should not error
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
});
}

Expand Down
Loading