Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix test isolate #9468

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Comment on lines +1926 to +1928
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I was looking for a way to have the fields of the JSON blob be more lenient yet still checked in Snapbox but couldn't get it to work.


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
Loading