-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(anvil
): --cache-path
#9343
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation LGTM, would you mind adding a test case for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! one minor question re testing the new setting
.with_max_persisted_states(Some(10_usize)) | ||
.with_blocktime(Some(Duration::from_millis(1))), | ||
) | ||
.await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to assert file was actually written in custom temp dir? I tried to manually test it but probably I am missing something as I wasn't able to get the json file dumped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah testing this is a bit hard. Wrote a better test here. 363010f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! yeah, managed to check file is generated with this test. I think that's good to have, drawback is that will slow down the CI (and potential flakiness), @zerosnacks wdyt?
If we are to keep it let's solve warnings here
https://github.com/foundry-rs/foundry/actions/runs/11933626813/job/33261072474#step:12:66
and maybe add one more assert to make sure the cache is actually populated
assert!(cache_path.read_dir().unwrap().next().is_some());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, only a comment re keeping the test or not @zerosnacks pls chime in
.with_max_persisted_states(Some(10_usize)) | ||
.with_blocktime(Some(Duration::from_millis(1))), | ||
) | ||
.await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! yeah, managed to check file is generated with this test. I think that's good to have, drawback is that will slow down the CI (and potential flakiness), @zerosnacks wdyt?
If we are to keep it let's solve warnings here
https://github.com/foundry-rs/foundry/actions/runs/11933626813/job/33261072474#step:12:66
and maybe add one more assert to make sure the cache is actually populated
assert!(cache_path.read_dir().unwrap().next().is_some());
Motivation
Closes #3512 + Closes #8654
Solution
Introduces the
--cache-path
flag to anvil letting users can configure where the old state is stored