feat: add --file
flag to forge test --gas-report
to write to file
#8781
Labels
A-gas-snapshots
Area: gas snapshotting/reporting
C-forge
Command: forge
T-blocked
Type: blocked
T-feature
Type: feature
Component
Forge
Describe the feature you would like
I would like that
forge test --gas-report
to be saved in a file, similar to whatforge snapshot
does.This could be either a different flag in
forge test --gas-report
likeforge-test --gas-report-file
or probably the better would beforge snapshot --gas-report
, so the gas report also generates a file called .gas-report with the table output offorge-test --gas-report
Additional context
forge test --gas-report
seems more complete thanforge snapshot
, because it actually tests the gas costs for different scenarios, for example when storage is loaded, or empty, etc, or different call stacks, and create a very useful report to see how the changes impact in gas usage.Currently I am using a custom commands on package.json to achieve this functionality:
Recently, forge changed a word in the test report, from "Test result" to "Suite result" that broke that command entirely in many repositories I am working. See vacp2p/foundry-template#31
This feature would avoid having to tweak with awk, and give peace of mind on both sides.
The text was updated successfully, but these errors were encountered: