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

feat: add --gas flag to ape test command to output gas reports after tests #1083

Merged
merged 16 commits into from Oct 6, 2022

Conversation

antazoey
Copy link
Contributor

@antazoey antazoey commented Sep 27, 2022

What I did

fixes: #350

How I did it

  • Add --gas flag to ape test command
  • In function isolation fixture, build the tree on each incoming receipt
  • In terminal reporting pytest hook, output the gas report

How to verify it

  1. Make sure to use a provider like ape-hardhat or ape-foundry that supports tracing.
  2. Go to your project with tests
  3. Run ape test --gas or however you run your tests, just include --gas.

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey
Copy link
Contributor Author

antazoey commented Oct 3, 2022

  • Fix regression in trace output (failing in hardhat tests)

@antazoey antazoey marked this pull request as ready for review October 3, 2022 23:04
@antazoey
Copy link
Contributor Author

antazoey commented Oct 3, 2022

Tests: ApeWorX/ape-hardhat#98

src/ape/pytest/fixtures.py Outdated Show resolved Hide resolved
fubuloubu
fubuloubu previously approved these changes Oct 5, 2022
@antazoey
Copy link
Contributor Author

antazoey commented Oct 6, 2022

  • Fix issue found in testing where we would get duplicate stats in the gas report (same call entered twice, thus corrupting the stats)

@antazoey
Copy link
Contributor Author

antazoey commented Oct 6, 2022

  • Fix issue where sessional and module-scoped fixtures containing receipts don't show up in gas report

@antazoey antazoey marked this pull request as draft October 6, 2022 14:47
@antazoey antazoey marked this pull request as ready for review October 6, 2022 14:50
@antazoey antazoey merged commit f4d46f5 into ApeWorX:main Oct 6, 2022
@antazoey antazoey deleted the feat/gas branch October 7, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing: Gas reporting in tests
2 participants