-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: do not remove snapshots
directory before running the test suite
#9645
fix: do not remove snapshots
directory before running the test suite
#9645
Conversation
…side effect is that any custom group names or file name changes are not reflected - this is delegated to the end user
Do i correctly understand that this would "overwrite the whole file", or would it only overwrite/update the affected lines in the snapshot? |
It would still overwrite the whole file. I agree that it would be preferable for individual tests to be merged into existing snapshots (overwriting existing keys, leaving the rest intact). This PR does not change the behavior. I'll tackle that in a follow-up PR as it requires a bit more consideration in terms of resource locking w/ multiple concurrent tests (as different test suites can write to the same file). |
* update docs in accordance to foundry-rs/foundry#9791 and foundry-rs/foundry#9645 * nit
Motivation
Ref: #9477 (comment)
Closes: #9477
Solution
Given the feedback we've received on the default behavior of removing the
snapshots
directory this PR proposes to remove the removal process all together.This PR intends to be minimally breaking in terms of end user experience.
The effect is that we no longer automatically clean up for the user if they have made a change in the following:
These files will now be
stained
and in turn this means it is the responsibility of the user to clean this up.forge clean
will no longer remove thesnapshots
directory. It is up to the user to manually delete the snapshots directory if they intend on clearing it out entirely.Reminder that users can configure the
snapshots
location to whatever folder they like.Running a single test will still overwrite the individual snapshot file and only write its single entry in.