-
Notifications
You must be signed in to change notification settings - Fork 385
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(gnovm): gno test
now has gas used information
#2571
base: master
Are you sure you want to change the base?
feat(gnovm): gno test
now has gas used information
#2571
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
If the gas used for each test case is displayed, that would be great :) |
And it would be even better if we displayed both the execution time and the gas used :) |
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.
Nice idea. Some style comments and also -- are also those lines supposed to commented out?
gnovm/cmd/gno/test.go
Outdated
@@ -205,7 +206,7 @@ func execTest(cfg *testCfg, args []string, io commands.IO) error { | |||
io.ErrPrintfln("FAIL") | |||
testErrCount++ | |||
} else { | |||
io.ErrPrintfln("ok %s \t%s", pkg.Dir, dstr) | |||
io.ErrPrintfln("ok %s \ttotal gas used: %d", pkg.Dir, gasUsed) |
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.
Why can't we have both gas used and duration? Both seem useful.
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.
I see that people are not often concern about that time so much.
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.
I'll ask in another way -- how do we benefit from removing it? If someone doesn't care about it then they don't have to use it. If someone does care about it then they have it. It's only a few more characters being printed.
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.
@deelawn
I am fine with keeping the duration to be displayed.
But I have another view, should we move duration to -print-runtime-metrics
which currently displaying runtime: cycle=%s imports=%d allocs=%s
?
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.
Before these changes, only subpackage level test execution displayed duration. The runtime metrics are something different. I'm only suggesting that we don't remove existing functionality if there is no good reason to do so. I don't think duration needs to be added anywhere else it doesn't currently exist.
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.
5a85bec
to
0cc91ce
Compare
This PR could be useful as we are currently dogfooding more and adding new data structures, such as btree, ulist, and AVL alternatives. @thehowl @ltzmaxwell, could you review this PR and share your thoughts on whether we should continue with it or consider a different implementation? After that, we can check if the original author is willing to update it or if we should find someone else to continue the work. Thank you. |
🛠 PR Checks Summary🔴 Maintainers must be able to edit this pull request (more info) 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
|
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the descriptionWhy do we have this PR?
After discussion in #2467 and #2149 that the
gno test
now has gas used information instead of execution time.Target:
gno test
hastotal gas used
informationgno test
hasgas used
for each xxx_filetest.gnoI will
add realm storage diff size
#2468 in another PR.