Skip to content

Commit

Permalink
chore: fix test isolate (#9468)
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy authored Dec 3, 2024
1 parent ade4b35 commit 8ef1302
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions crates/forge/tests/cli/ext_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ fn lil_web3() {

#[test]
#[cfg_attr(windows, ignore = "Windows cannot find installed programs")]
#[cfg(not(feature = "isolate-by-default"))]
fn snekmate() {
ExtTester::new("pcaversaccio", "snekmate", "df226f4a45e86c8f8c3ff1f9fa3443d260002050")
.install_command(&["pnpm", "install", "--prefer-offline"])
Expand Down
10 changes: 7 additions & 3 deletions crates/forge/tests/cli/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,10 @@ contract SimpleScript is Script {

// Asserts that the script runs with expected non-output using `--quiet` flag
forgetest_async!(adheres_to_json_flag, |prj, cmd| {
if cfg!(feature = "isolate-by-default") {
return;
}

foundry_test_utils::util::initialize(prj.root());
prj.add_script(
"Foo",
Expand Down Expand Up @@ -2367,12 +2371,12 @@ contract SimpleScript is Script {
[SOLC_VERSION] [ELAPSED]
Compiler run successful!
Traces:
[103771] SimpleScript::run()
[..] SimpleScript::run()
├─ [0] VM::startBroadcast()
│ └─ ← [Return]
├─ [23273] → new A@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
├─ [..] → new A@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
│ └─ ← [Return] 116 bytes of code
├─ [13162] → new B@0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496
├─ [..] → new B@0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496
│ ├─ [145] A::getValue() [staticcall]
│ │ └─ ← [Return] 100
│ └─ ← [Return] 62 bytes of code
Expand Down
13 changes: 7 additions & 6 deletions crates/forge/tests/cli/test_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2357,10 +2357,10 @@ Compiler run successful!
Ran 1 test for test/MetadataTraceTest.t.sol:MetadataTraceTest
[PASS] test_proxy_trace() ([GAS])
Traces:
[149783] MetadataTraceTest::test_proxy_trace()
├─ [47297] → new Counter@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
[..] MetadataTraceTest::test_proxy_trace()
├─ [..] → new Counter@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
│ └─ ← [Return] 236 bytes of code
├─ [37762] → new Proxy@0x2e234DAe75C793f67A35089C9d99245E1C58470b
├─ [..] → new Proxy@0x2e234DAe75C793f67A35089C9d99245E1C58470b
│ └─ ← [Return] 62 bytes of code
└─ ← [Stop]
Expand All @@ -2382,10 +2382,10 @@ Compiler run successful!
Ran 1 test for test/MetadataTraceTest.t.sol:MetadataTraceTest
[PASS] test_proxy_trace() ([GAS])
Traces:
[128142] MetadataTraceTest::test_proxy_trace()
├─ [36485] → new Counter@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
[..] MetadataTraceTest::test_proxy_trace()
├─ [..] → new Counter@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
│ └─ ← [Return] 182 bytes of code
├─ [26959] → new Proxy@0x2e234DAe75C793f67A35089C9d99245E1C58470b
├─ [..] → new Proxy@0x2e234DAe75C793f67A35089C9d99245E1C58470b
│ └─ ← [Return] 8 bytes of code
└─ ← [Stop]
Expand Down Expand Up @@ -2667,6 +2667,7 @@ Suite result: FAILED. 0 passed; 1 failed; 0 skipped; [ELAPSED]
});

// Tests that test traces display state changes when running with verbosity.
#[cfg(not(feature = "isolate-by-default"))]
forgetest_init!(should_show_state_changes, |prj, cmd| {
cmd.args(["test", "--mt", "test_Increment", "-vvvvv"]).assert_success().stdout_eq(str![[r#"
...
Expand Down

0 comments on commit 8ef1302

Please sign in to comment.