From 5a3ad49f2ff49bda83ad964c9b1108f03d02ef05 Mon Sep 17 00:00:00 2001 From: d1t2 Date: Sun, 30 Jun 2024 23:53:57 +0800 Subject: [PATCH] test: Migrate git_auth to snapbox - gitoxide/macos fix --- tests/testsuite/git_auth.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/testsuite/git_auth.rs b/tests/testsuite/git_auth.rs index 09bdaf7da49a..691aaf99f13a 100644 --- a/tests/testsuite/git_auth.rs +++ b/tests/testsuite/git_auth.rs @@ -241,7 +241,7 @@ Caused by: An IO error occurred when talking to the server Caused by: - [35] SSL connect error (schannel: failed to receive handshake, SSL/TLS connection failed)" + [35] SSL connect error ([..])" } else if cfg!(windows) { r"\ failed to send request: A connection with the server could not be established @@ -250,7 +250,7 @@ Caused by: // macOS is difficult to tests as some builds may use Security.framework, // while others may use OpenSSL. In that case, let's just not verify the error // message here. - "[..]" + "..." } else { r" SSL [ERROR] syscall failure: ; class=Os (2)" } @@ -302,10 +302,9 @@ fn ssh_something_happens() { // "[..]banner exchange: Connection to 127.0.0.1 [..]" // banner exchange: Connection to 127.0.0.1 port 62250: Software caused connection abort // But since there is no common meaningful sequence or word, we can only match a small telling sequence of characters. - "onnect".to_string() + "onnect" } else { - format!( - r" + r" Caused by: failed to clone into: [ROOT]/home/.cargo/git/db/bar-[HASH] @@ -318,11 +317,7 @@ Caused by: An IO error occurred when talking to the server Caused by: - Connection closed by {} port {} -", - addr.ip(), - addr.port() - ) + [..]Connection closed by [..]" }; format!( "\ @@ -393,9 +388,9 @@ fn net_err_suggests_fetch_with_cli() { .with_stderr_data(format!( "\ [UPDATING] git repository `ssh://needs-proxy.invalid/git` -[WARNING] spurious network error (3 tries remaining): failed to resolve address for needs-proxy.invalid: Name or service not known; class=Net (12) -[WARNING] spurious network error (2 tries remaining): failed to resolve address for needs-proxy.invalid: Name or service not known; class=Net (12) -[WARNING] spurious network error (1 tries remaining): failed to resolve address for needs-proxy.invalid: Name or service not known; class=Net (12) +[WARNING] spurious network error (3 tries remaining): [..] resolve [..] needs-proxy.invalid: [..] not known[..] +[WARNING] spurious network error (2 tries remaining): [..] resolve [..] needs-proxy.invalid: [..] not known[..] +[WARNING] spurious network error (1 tries remaining): [..] resolve [..] needs-proxy.invalid: [..] not known[..] [ERROR] failed to get `foo` as a dependency of package `foo v0.0.0 ([ROOT]/foo)` Caused by: @@ -419,9 +414,9 @@ Caused by: r" An IO error occurred when talking to the server Caused by: - ssh: Could not resolve hostname needs-proxy.invalid" + ssh: Could not resolve hostname needs-proxy.invalid[..]" } else { - " failed to resolve address for needs-proxy.invalid: Name or service not known; class=Net (12)" + " failed to resolve address for needs-proxy.invalid: [..] not known; class=Net (12)" } )) .run(); @@ -439,7 +434,7 @@ Caused by: .with_stderr_data(str![[r#" [UPDATING] git repository `ssh://needs-proxy.invalid/git` [RUNNING] `git fetch --verbose --force --update-head-ok 'ssh://needs-proxy.invalid/git' '+HEAD:refs/remotes/origin/HEAD'` -ssh: Could not resolve hostname needs-proxy.invalid: Name or service not known +ssh: Could not resolve hostname needs-proxy.invalid: [..] not known fatal: Could not read from remote repository. Please make sure you have the correct access rights