-
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(cheatcodes): forge execution context check #7377
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.
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! test failures seem spurious, so waiting on another review
yeah, according to https://github.com/foundry-rs/foundry/blob/master/docs/dev/cheatcodes.md
|
It's not spurious, you have to run the command locally as the output and doc suggest |
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
@grandizzy I ran |
@mattsse yeah, sorry, my bad, was something I missed for adding the new enum, should be fixed now (forced pushed your commit). @Evalir 's comment re CI failing was a legit concern 🤦♂️ |
yep @grandizzy sorry for the confusion here—first CI failure comment seemed spurious but below there was the |
Motivation
Closes #2900
Solution
Add a global /execution context based on
forge
subcommand used - can be set only once per program, and it can be checked by usingisContext(ForgeContext context)
env cheatcode.ForgeContext
have following options:TestGroup
: Test group execution context (test, coverage or snapshot).Test
Coverage
Snapshot
ScriptGroup
: Script group execution context (dry run, broadcast or resume)ScriptDryRun
ScriptBroadcast
ScriptResume
Unknown