-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: allow any config to be defined inline #9430
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
Conversation
grandizzy
left a comment
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.
Awesome stuff! gave #6228 (comment) a try with inline paris and shanghai and works great. I think this PR should close #6228 too per #6228 (comment) (1st and 3rd bullets are covered in this PR, the 2nd bullet / automatic detection is tracked in #6440)
should we clean up tests a little bit too (like merging testdata/paris in testdata/default and removing the TEST_DATA_PARIS / paris ForgeTestProfile profile and using inline config for specifying the evm version), or better to keep separate profiles? (I can follow up in a PR after we merge this one)
grandizzy
left a comment
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!
mattsse
left a comment
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.
hell yeah
|
@DaniPopes should this PR make it possible to set |
|
@smartcontracts you may want to check compiler profiles and compiler restrictions added in #8668 |
Allow any configuration value to be defined inline using the same TOML syntax as foundry.toml.
This is achieved by updating
Config,Executoretc. fields with the new inlineConfigvalue saved in aTestRunnerConfigfield for each level of tests:MultiContractRunner, globalContractRunner, contract-level, applied before running any EVM codeFunctionRunner(new), function-level, applied before running each testTestRunnerConfigis inherited from the level before, and updated with inline config whenever it's available.Not all configs will do something at every level; for example the fork stuff is spawned at contract-level so changing that at function level won't have any effect, but for that there is cheatcodes.
TestOptions's functionality has been moved toFunctionRunner.Closes #8564.
Closes #6908.
Closes #6228.