From 2b27914659fcdeddbcaa26035ab484f0132fee7b Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sat, 6 Jul 2024 09:40:26 -0400 Subject: [PATCH 1/2] test: relax redaction for sysroot sysroot is different when bootstrapping rustc ``` ---- expected: tests/testsuite/cfg.rs:444:27 ++++ actual: stderr 1 1 | [ERROR] output of --print=split-debuginfo missing when learning about target-specific information from rustc 2 2 | command was: `[ROOT]/compiler/target/debug/compiler[..]--crate-type [..]` 3 3 | 4 4 | --- stdout 5 5 | ___[EXE] 6 6 | lib___.rlib 7 7 | [..]___.[..] 8 8 | [..]___.[..] 9 9 | [..]___.[..] 10 10 | [..]___.[..] 11 - [..]rust[..] 11 + /checkout/obj/build/[HOST_TARGET]/stage2 12 12 | ``` https://github.com/rust-lang-ci/rust/actions/runs/9814397548/job/27101968836#step:25:10913 --- tests/testsuite/cfg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/cfg.rs b/tests/testsuite/cfg.rs index 45aa2b0a0de..3a2ad71253d 100644 --- a/tests/testsuite/cfg.rs +++ b/tests/testsuite/cfg.rs @@ -452,7 +452,7 @@ lib___.rlib [..]___.[..] [..]___.[..] [..]___.[..] -[..]rust[..] +[..] "#]]) @@ -470,7 +470,7 @@ lib___.rlib [..]___.[..] [..]___.[..] [..]___.[..] -[..]rust[..] +[..] [..],[..] ___ 123 From e491c064362d111430cf35cbc089b034152e48d1 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sat, 6 Jul 2024 10:00:32 -0400 Subject: [PATCH 2/2] test: relax redaction for running `ssh` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ssh` binary is not available on some platforms. https://github.com/rust-lang-ci/rust/actions/runs/9814397548/job/27101968836#step:25:10940 ``` ---- git_auth::net_err_suggests_fetch_with_cli stdout ---- running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -v` running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -v` thread 'git_auth::net_err_suggests_fetch_with_cli' panicked at tests/testsuite/git_auth.rs:439:10: ---- expected: tests/testsuite/git_auth.rs:415:27 ++++ actual: stderr 1 1 | [UPDATING] git repository `ssh://needs-proxy.invalid/git` 2 2 | [RUNNING] `git fetch --verbose --force --update-head-ok [..]ssh://needs-proxy.invalid/git[..] [..]+HEAD:refs/remotes/origin/HEAD[..]` 3 - ssh: Could not resolve hostname needs-proxy.invalid: [..] not known 4 - fatal: Could not read from remote repository. 5 - 6 - Please make sure you have the correct access rights 7 - and the repository exists. 3 + [ERROR] cannot run ssh: No such file or directory 4 + fatal: unable to fork 8 5 | [ERROR] failed to get `foo` as a dependency of package `foo v0.0.0 ([ROOT]/foo)` 9 6 | 10 7 | Caused by: 11 8 | failed to load source for dependency `foo` 12 9 | ⋮ 15 12 | 16 13 | Caused by: 17 14 | failed to fetch into: [ROOT]/home/.cargo/git/db/git-[HASH] 18 15 | 19 16 | Caused by: 20 - process didn't exit successfully: `git fetch --verbose --force --update-head-ok [..]ssh://needs-proxy.invalid/git[..] [..]+HEAD:refs/remotes/origin/HEAD[..]` ([EXIT_STATUS]: 128) 17 + process didn't exit successfully: `git fetch --verbose --force --update-head-ok 'ssh://needs-proxy.invalid/git' '+HEAD:refs/remotes/origin/HEAD'` ([EXIT_STATUS]: 128) ``` --- tests/testsuite/git_auth.rs | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/tests/testsuite/git_auth.rs b/tests/testsuite/git_auth.rs index e071966935d..16eefb20171 100644 --- a/tests/testsuite/git_auth.rs +++ b/tests/testsuite/git_auth.rs @@ -8,9 +8,10 @@ use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; use std::sync::Arc; use std::thread::{self, JoinHandle}; +use cargo_test_support::basic_manifest; use cargo_test_support::git::cargo_uses_gitoxide; use cargo_test_support::paths; -use cargo_test_support::{basic_manifest, project, str}; +use cargo_test_support::project; fn setup_failed_auth_test() -> (SocketAddr, JoinHandle<()>, Arc) { let server = TcpListener::bind("127.0.0.1:0").unwrap(); @@ -412,29 +413,7 @@ Caused by: p.cargo("check -v") .with_status(101) - .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: [..] not known -fatal: Could not read from remote repository. - -Please make sure you have the correct access rights -and the repository exists. -[ERROR] failed to get `foo` as a dependency of package `foo v0.0.0 ([ROOT]/foo)` - -Caused by: - failed to load source for dependency `foo` - -Caused by: - Unable to update ssh://needs-proxy.invalid/git - -Caused by: - failed to fetch into: [ROOT]/home/.cargo/git/db/git-[HASH] - -Caused by: - process didn't exit successfully: `git fetch --verbose --force --update-head-ok [..]ssh://needs-proxy.invalid/git[..] [..]+HEAD:refs/remotes/origin/HEAD[..]` ([EXIT_STATUS]: 128) - -"#]]) + .with_stderr_contains("[..]Unable to update[..]") .with_stderr_does_not_contain("[..]try enabling `git-fetch-with-cli`[..]") .run(); }