From bcc3d461209b9b51bc85df3ed339f16071e76227 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:59:09 +0200 Subject: [PATCH 1/5] ci: --no-capture --- .github/scripts/matrices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/matrices.py b/.github/scripts/matrices.py index 7af235efce2f4..f8564217dbfa7 100755 --- a/.github/scripts/matrices.py +++ b/.github/scripts/matrices.py @@ -129,6 +129,7 @@ def main(): name += os_str flags += " --no-fail-fast" + flags += " --no-capture" obj = Expanded( name=name, From 1f09fe30a9fb6ebd4a51e8b6ca722d050db36187 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 23 Sep 2025 01:09:51 +0200 Subject: [PATCH 2/5] asserts --- crates/forge/tests/it/test_helpers.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/forge/tests/it/test_helpers.rs b/crates/forge/tests/it/test_helpers.rs index 59139600f78a6..64ded75d69b4b 100644 --- a/crates/forge/tests/it/test_helpers.rs +++ b/crates/forge/tests/it/test_helpers.rs @@ -295,7 +295,6 @@ pub fn get_vyper() -> Vyper { }) } -#[tracing::instrument] pub fn get_compiled(project: &mut Project) -> ProjectCompileOutput { let lock_file_path = project.sources_path().join(".lock"); // Compile only once per test run. @@ -313,6 +312,9 @@ pub fn get_compiled(project: &mut Project) -> ProjectCompileOutput { test_debug!("cache miss for {}", lock_file_path.display()); } else { test_debug!("cache hit for {}", lock_file_path.display()); + assert!(project.cache_path().exists()); + assert!(project.artifacts_path().exists()); + assert!(project.artifacts_path().read_dir().unwrap().count() > 0); } if project.compiler.vyper.is_none() { From e3f358c4aa35edec4d3b1f3fbb272af196ad6eb2 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 23 Sep 2025 03:20:13 +0200 Subject: [PATCH 3/5] dbg --- crates/test-utils/src/util.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index e1e53ba59218f..bbc459f1e3d59 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -166,7 +166,7 @@ impl ExtTester { if self.rev.is_empty() { let mut git = Command::new("git"); git.current_dir(root).args(["log", "-n", "1"]); - println!("$ {git:?}"); + test_debug!("$ {git:?}"); let output = git.output().unwrap(); if !output.status.success() { panic!("git log failed: {output:?}"); @@ -177,7 +177,7 @@ impl ExtTester { } else { let mut git = Command::new("git"); git.current_dir(root).args(["checkout", self.rev]); - println!("$ {git:?}"); + test_debug!("$ {git:?}"); let status = git.status().unwrap(); if !status.success() { panic!("git checkout failed: {status}"); @@ -191,16 +191,16 @@ impl ExtTester { for install_command in &self.install_commands { let mut install_cmd = Command::new(&install_command[0]); install_cmd.args(&install_command[1..]).current_dir(root); - println!("cd {root}; {install_cmd:?}"); + test_debug!("cd {root}; {install_cmd:?}"); match install_cmd.status() { Ok(s) => { - println!("\n\n{install_cmd:?}: {s}"); + test_debug!("\n\n{install_cmd:?}: {s}"); if s.success() { break; } } Err(e) => { - eprintln!("\n\n{install_cmd:?}: {e}"); + test_debug!("\n\n{install_cmd:?}: {e}"); } } } @@ -210,7 +210,7 @@ impl ExtTester { pub fn run(&self) { // Skip fork tests if the RPC url is not set. if self.fork_block.is_some() && std::env::var_os("ETH_RPC_URL").is_none() { - eprintln!("ETH_RPC_URL is not set; skipping"); + test_debug!("ETH_RPC_URL is not set; skipping"); return; } @@ -253,7 +253,7 @@ impl ExtTester { /// This sets the project's solc version to the [`SOLC_VERSION`]. #[expect(clippy::disallowed_macros)] pub fn initialize(target: &Path) { - println!("initializing {}", target.display()); + test_debug!("initializing {}", target.display()); let tpath = TEMPLATE_PATH.as_path(); pretty_err(tpath, fs::create_dir_all(tpath)); @@ -281,7 +281,7 @@ pub fn initialize(target: &Path) { if data != "1" { // Initialize and build. let (prj, mut cmd) = setup_forge("template", foundry_compilers::PathStyle::Dapptools); - println!("- initializing template dir in {}", prj.root().display()); + test_debug!("- initializing template dir in {}", prj.root().display()); cmd.args(["init", "--force"]).assert_success(); prj.write_config(Config { @@ -317,7 +317,7 @@ pub fn initialize(target: &Path) { _read = lock.read().unwrap(); } - println!("- copying template dir from {}", tpath.display()); + test_debug!("- copying template dir from {}", tpath.display()); pretty_err(target, fs::create_dir_all(target)); pretty_err(target, copy_dir(tpath, target)); } @@ -327,12 +327,12 @@ pub fn clone_remote(repo_url: &str, target_dir: &str) { let mut cmd = Command::new("git"); cmd.args(["clone", "--recursive", "--shallow-submodules"]); cmd.args([repo_url, target_dir]); - println!("{cmd:?}"); + test_debug!("{cmd:?}"); let status = cmd.status().unwrap(); if !status.success() { panic!("git clone failed: {status}"); } - println!(); + test_debug!(); } /// Setup an empty test project and return a command pointing to the forge @@ -1028,7 +1028,7 @@ impl TestCommand { #[track_caller] pub fn try_execute(&mut self) -> std::io::Result { - println!("executing {:?}", self.cmd); + test_debug!("executing {:?}", self.cmd); let mut child = self.cmd.stdout(Stdio::piped()).stderr(Stdio::piped()).stdin(Stdio::piped()).spawn()?; if let Some(fun) = self.stdin_fun.take() { From 00a57b9e6560907f7b3796297c2766319afdb14b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 23 Sep 2025 03:21:06 +0200 Subject: [PATCH 4/5] debug more --- crates/test-utils/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/test-utils/src/lib.rs b/crates/test-utils/src/lib.rs index 79975413ca68f..3a0b2275f43fa 100644 --- a/crates/test-utils/src/lib.rs +++ b/crates/test-utils/src/lib.rs @@ -54,7 +54,7 @@ pub fn init_tracing() { fn env_filter() -> tracing_subscriber::EnvFilter { const DEFAULT_DIRECTIVES: &[&str] = &include!("../../cli/src/utils/default_directives.txt"); let mut filter = tracing_subscriber::EnvFilter::builder() - .with_default_directive("foundry_test_utils=debug".parse().unwrap()) + .with_default_directive("debug".parse().unwrap()) .from_env_lossy(); for &directive in DEFAULT_DIRECTIVES { filter = filter.add_directive(directive.parse().unwrap()); From cbb466641b8b35707325c3f4f8518a6eb9a6a940 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 23 Sep 2025 03:23:36 +0200 Subject: [PATCH 5/5] fix --- crates/test-utils/src/macros.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/test-utils/src/macros.rs b/crates/test-utils/src/macros.rs index 3fc25ad66f2c7..a9363e81113e8 100644 --- a/crates/test-utils/src/macros.rs +++ b/crates/test-utils/src/macros.rs @@ -125,6 +125,7 @@ macro_rules! forgesoldeer { #[macro_export] macro_rules! test_debug { + () => { $crate::test_debug!("") }; ($($args:tt)*) => { $crate::test_debug(format_args!($($args)*)) }