Skip to content

Commit

Permalink
Auto merge of #14187 - dieterplex:migrate-ssh-snapbox, r=epage
Browse files Browse the repository at this point in the history
test: Migrate network tests to snapbox

Part of #14039.
  • Loading branch information
bors committed Jul 4, 2024
2 parents d1b5f07 + 47253e4 commit 3a76b8c
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 103 deletions.
23 changes: 10 additions & 13 deletions tests/testsuite/https.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
//! Note that these tests will generally require setting CARGO_CONTAINER_TESTS
//! or CARGO_PUBLIC_NETWORK_TESTS.

#![allow(deprecated)]

use cargo_test_support::containers::Container;
use cargo_test_support::project;
use cargo_test_support::str;

#[cargo_test(container_test)]
fn self_signed_should_fail() {
Expand Down Expand Up @@ -43,10 +42,10 @@ fn self_signed_should_fail() {
};
p.cargo("fetch")
.with_status(101)
.with_stderr(&format!(
.with_stderr_data(&format!(
"\
[UPDATING] git repository `https://127.0.0.1:[..]/repos/bar.git`
error: failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
[ERROR] failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
Caused by:
failed to load source for dependency `bar`
Expand All @@ -55,7 +54,7 @@ Caused by:
Unable to update https://127.0.0.1:[..]/repos/bar.git
Caused by:
failed to clone into: [ROOT]/home/.cargo/git/db/bar-[..]
failed to clone into: [ROOT]/home/.cargo/git/db/bar-[HASH]
Caused by:
network failure seems to have happened
Expand Down Expand Up @@ -129,12 +128,11 @@ fn self_signed_with_cacert() {
.file("server.crt", &server_crt)
.build();
p.cargo("fetch")
.with_stderr(
"\
.with_stderr_data(str![[r#"
[UPDATING] git repository `https://127.0.0.1:[..]/repos/bar.git`
[LOCKING] 2 packages to latest compatible versions
",
)
"#]])
.run();
}

Expand All @@ -157,11 +155,10 @@ fn github_works() {
.file("src/lib.rs", "")
.build();
p.cargo("fetch")
.with_stderr(
"\
.with_stderr_data(str![[r#"
[UPDATING] git repository `https://github.com/rust-lang/bitflags.git`
[LOCKING] 2 packages to latest compatible versions
",
)
"#]])
.run();
}
Loading

0 comments on commit 3a76b8c

Please sign in to comment.