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

No gas-report for property-based tests #1023

Closed
2 tasks done
0xalfalfa opened this issue Mar 23, 2022 · 5 comments
Closed
2 tasks done

No gas-report for property-based tests #1023

0xalfalfa opened this issue Mar 23, 2022 · 5 comments
Assignees
Labels
A-gas-snapshots Area: gas snapshotting/reporting A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug

Comments

@0xalfalfa
Copy link

0xalfalfa commented Mar 23, 2022

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.1.0 (22323e2 2022-03-23T00:09:43.397848305+00:00)

What command(s) is the bug in?

forge test --gas-report

Operating System

Linux

Describe the bug

Property-based tests do not seem to generate data for gas-reports.

  • If there are only property-based (fuzzying) tests defined, the --gas-report flag does not generate a gas-report output at all.
  • If there are property-based tests and tests without function arguments, only the calls to the later generate data for the gas-report.

Expected behaviour:

Why not use the large number of fuzzing function calls for the gas report?

@0xalfalfa 0xalfalfa added the T-bug Type: bug label Mar 23, 2022
@onbjerg onbjerg added A-testing Area: testing Cmd-forge-test Command: forge test C-forge Command: forge A-gas-snapshots Area: gas snapshotting/reporting labels Mar 23, 2022
@onbjerg
Copy link
Member

onbjerg commented Mar 23, 2022

This is probably fixed with REVM #918

@onbjerg onbjerg assigned onbjerg and unassigned onbjerg Mar 23, 2022
@onbjerg
Copy link
Member

onbjerg commented Mar 23, 2022

This is not fixed with REVM. It's not super trivial to do this since we need to collect traces for all fuzz cases which could end up slowing down Forge a lot. Will think about this more

@onbjerg onbjerg added this to Foundry Apr 17, 2022
@onbjerg onbjerg moved this to Todo in Foundry Apr 17, 2022
@hbarcelos
Copy link

Couldn't you sample only a small % of the fuzz cases to generate the gas reports? Maybe 2% could be enough.

This was referenced Aug 15, 2022
@onbjerg onbjerg self-assigned this Aug 15, 2022
@lucas-manuel
Copy link

Close-able? @mds1

@mds1
Copy link
Collaborator

mds1 commented May 18, 2023

Yep this is now implemented

@mds1 mds1 closed this as completed May 18, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-gas-snapshots Area: gas snapshotting/reporting A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

5 participants