-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Increase test coverage #4971
Increase test coverage #4971
Conversation
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.
Thanks for extending AMM code coverage!
I left a few minor comments.
I still need to go over LCOV_EXCL
to check whether it can be covered or not. I wanted to provide the feedback on the unit-tests sooner.
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.
Added LCOV_EXCL
looks correct.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4971 +/- ##
=========================================
+ Coverage 70.8% 70.9% +0.1%
=========================================
Files 796 796
Lines 66785 66727 -58
Branches 11034 10978 -56
=========================================
+ Hits 47301 47341 +40
+ Misses 19484 19386 -98
|
@gregtatcam can you help me try to convert the last tests, in 43a251c, to use |
Will do |
@thejohnfreeman |
@gregtatcam Right, that's why the return value is passed to |
Right, sorry. But then all tests would have to be changed. I'm doing a few things in |
|
@gregtatcam I only changed the calls to |
Thanks. Will review today or Monday. |
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.
Overall looks good.
Remaining areas to address:
- Move AMMWithdraw_test to AMM_test. It would be great overall to be able to run tests individually like AMMWitrhdraw, AMMDeposit, etc.; but not in this PR.
- Updated
bid
method changes the default behavior. I.e.,env.close()
is generally called after every bid but the updated tests don't always callclose
. Should it be added? Can deposit non-frozen token
comment should be updated.- There are two suggestions to consider for the comments update.
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.
Note, if we merged https://app.codecov.io/gh/XRPLF/rippled/pull/4977 into develop
before this PR, then codecov statistics would be relative to the changes (we would have merged) in #4977 , and it would be quite visible that this PR has increased overall coverage from 70.8% to 70.9%
@@ -56,9 +56,6 @@ class STIssue final : public STBase, CountedObject<STIssue> | |||
SerializedTypeID | |||
getSType() const override; | |||
|
|||
std::string | |||
getText() const override; | |||
|
|||
Json::Value getJson(JsonOptions) const override; |
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 love how this PR also contains the removal of dead code 🥇
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
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.
👍
editing the JSON. | ||
*/ | ||
std::shared_ptr<STTx const> | ||
ust(JTx const& jt); |
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.
Consider giving this a more descriptive name
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.
@mtrippled please suggest a name. I don't know what this should be named, or what "ust" stands for.
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.
Unsanitized serialized transaction?
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.
Yes
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.
@ximinez I think John wanted to update the name of this function before the merge 😅
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.
Woops. @thejohnfreeman, if you (or someone else) wants to open a "trivial" PR with the name change, I'll approve and merge it.
@@ -60,9 +60,12 @@ ammHolds( | |||
*optIssue2, | |||
std::make_optional(std::make_pair(issue1, issue2)))) | |||
{ | |||
// This error can only be hit if the AMM is corrupted | |||
// LCOV_EXCL_START |
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 looked at the exclusions, and I'm OK with keeping them. I might feel differently if there were an excessive number of them, but there are relatively few and seem reasonably justified. I don't think we're in danger if we keep them.
I'm guessing we'll do another PR in the future with more exclusions. We may want to revisit some of these exclusions in that PR, but this is OK for now and also not the end of the world if we don't revisit in the future PR.
--------- Co-authored-by: Howard Hinnant <[email protected]> Co-authored-by: Mark Travis <[email protected]> Co-authored-by: Bronek Kozicki <[email protected]> Co-authored-by: Mayukha Vadari <[email protected]> Co-authored-by: Chenna Keshava <[email protected]>
No description provided.