Skip to content

Commit

Permalink
test: Migrate git_auth to snapbox - gitoxide/macos fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dieterplex committed Jun 30, 2024
1 parent 792e301 commit 5a3ad49
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions tests/testsuite/git_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
}
Expand Down Expand Up @@ -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]
Expand All @@ -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!(
"\
Expand Down Expand Up @@ -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:
Expand All @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit 5a3ad49

Please sign in to comment.