-
Notifications
You must be signed in to change notification settings - Fork 445
chore(test): Show gas used in gno test results #5076
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
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
38f98a5 to
1799080
Compare
notJoon
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
| err = m.CheckEmpty() | ||
| if err != nil { | ||
| return "", fmt.Errorf("machine not empty after main: %w", err) | ||
| return "", m.GasMeter.GasConsumed(), fmt.Errorf("machine not empty after main: %w", err) |
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.
maybe we can also print it to a // Gas: directive for a filetest?
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.
OK. How to make the filetest cause the "machine not empty after main" error?
Co-authored-by: ltzmaxwell <ltz.maxwell@gmail.com>
Co-authored-by: ltzmaxwell <ltz.maxwell@gmail.com>
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Resolve issue comment #1998 (comment) .
To show the gas used in
gno testresults:runFiletestalready creates a virtual machine with a gas meter. We updaterunFiletestto add a return value form.GasMeter.GasConsumed()TestcallsrunFiletest, get and display the gas usedrunTestFilescreates a virtual machine by callingMachine, where we add an optional paramgasMeter. InrunTestFileswe set this tostore.NewInfiniteGasMeter().runTestFilesusesm.Evalto evaluate the gno test, it prints the gas used(elapsed: 0.01s, gas: 648732)Sample output:
(The CI check for codecov often fails for the filetest infrastructure. Suggest to ignore.)
In the future, when #4953 is merged, then we can integrate tests with this detail.