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

snapshotGasLastCall weird folder removal behavior #9511

Closed
2 tasks done
sakulstra opened this issue Dec 6, 2024 · 1 comment
Closed
2 tasks done

snapshotGasLastCall weird folder removal behavior #9511

sakulstra opened this issue Dec 6, 2024 · 1 comment
Labels
A-cheatcodes Area: cheatcodes T-bug Type: bug

Comments

@sakulstra
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge --version

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

When running a forge test containing snapshotGasLastCall, forge will remove the folder and recreate the files.
This behavior is quite problematic on bigger codebases as it's recommended to check the snapshots in git, but running test via forge test --mc SomeTestContract will remove all snapshots, but only recreate the ones created within the test I am running.

Imo it would be far less problematic & better UX, to just overwrite the affected file instead of removing the whole folder.


On some editors (at least zed) the current behavior is also problematic in regards to file watching as the removal and recreation will not be properly detected. Instead the stale(removed) file will be shown till a manual reload (close/open) by the user happens.

@zerosnacks
Copy link
Member

Hi @sakulstra

Thanks for flagging this, there is currently another ticket open in regards to the folder removal - would be great to receive you input there: #9477

See: #9477 (comment)

Marking as duplicate in favor of the linked ticket

@zerosnacks zerosnacks closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 9, 2024
@zerosnacks zerosnacks added A-cheatcodes Area: cheatcodes and removed T-needs-triage Type: this issue needs to be labelled labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes T-bug Type: bug
Projects
Status: Done
Development

No branches or pull requests

2 participants