diff --git a/crates/forge/tests/it/config.rs b/crates/forge/tests/it/config.rs index 95d03110fff9..b9473b1526f2 100644 --- a/crates/forge/tests/it/config.rs +++ b/crates/forge/tests/it/config.rs @@ -13,10 +13,8 @@ use foundry_evm::{ decode::decode_console_logs, inspectors::CheatsConfig, revm::primitives::SpecId, }; use foundry_test_utils::Filter; -use std::{ - collections::BTreeMap, - path::{Path, PathBuf}, -}; +use itertools::Itertools; +use std::{collections::BTreeMap, path::Path}; /// How to execute a a test run pub struct TestConfig { @@ -82,11 +80,12 @@ impl TestConfig { let outcome = if self.should_fail { "fail" } else { "pass" }; eyre::bail!( - "Test {} did not {} as expected.\nReason: {:?}\nLogs:\n{}", + "Test {} did not {} as expected.\nReason: {:?}\nLogs:\n{}\n\nTraces:\n{}", test_name, outcome, result.reason, - logs.join("\n") + logs.join("\n"), + result.traces.iter().map(|(_, a)| a).format("\n"), ) } } @@ -136,14 +135,14 @@ pub(crate) fn init_tracing() { .try_init(); } -pub fn manifest_root() -> PathBuf { +pub fn manifest_root() -> &'static Path { let mut root = Path::new(env!("CARGO_MANIFEST_DIR")); // need to check here where we're executing the test from, if in `forge` we need to also allow // `testdata` if root.ends_with("forge") { root = root.parent().unwrap(); } - root.to_path_buf() + root } /// Builds a base runner @@ -161,7 +160,7 @@ pub async fn runner() -> MultiContractRunner { /// Builds a non-tracing runner pub async fn runner_with_config(mut config: Config) -> MultiContractRunner { config.rpc_endpoints = rpc_endpoints(); - config.allow_paths.push(manifest_root()); + config.allow_paths.push(manifest_root().to_path_buf()); let root = &PROJECT.paths.root; let opts = &*EVM_OPTS; diff --git a/crates/forge/tests/it/test_helpers.rs b/crates/forge/tests/it/test_helpers.rs index 3307514d7242..a2d703b02081 100644 --- a/crates/forge/tests/it/test_helpers.rs +++ b/crates/forge/tests/it/test_helpers.rs @@ -72,6 +72,7 @@ pub static EVM_OPTS: Lazy = Lazy::new(|| EvmOpts { sender: Config::DEFAULT_SENDER, initial_balance: U256::MAX, ffi: true, + verbosity: 3, ..Default::default() }); diff --git a/testdata/foundry.toml b/testdata/foundry.toml index d696945d0640..94bdeea39493 100644 --- a/testdata/foundry.toml +++ b/testdata/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -solc = "0.8.19" +solc = "0.8.18" block_base_fee_per_gas = 0 block_coinbase = "0x0000000000000000000000000000000000000000" block_difficulty = 0 @@ -36,10 +36,10 @@ remappings = ["ds-test/=lib/ds-test/src/"] sender = "0x00a329c0648769a73afac7f9381e08fb43dbea72" sizes = false sparse_mode = false -src = "src" -test = "test" +src = "./" +test = "./" tx_origin = "0x00a329c0648769a73afac7f9381e08fb43dbea72" -verbosity = 0 +verbosity = 3 via_ir = false fs_permissions = [{ access = "read-write", path = "./" }]