-
Notifications
You must be signed in to change notification settings - Fork 43
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
test: Boost test coverage for collection_update #1050
test: Boost test coverage for collection_update #1050
Conversation
dedb3db
to
0f56f36
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1050 +/- ##
===========================================
+ Coverage 67.90% 68.18% +0.27%
===========================================
Files 171 171
Lines 16275 16211 -64
===========================================
+ Hits 11052 11053 +1
+ Misses 4298 4235 -63
+ Partials 925 923 -2
|
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. If we want those functions back in the future we can always refer to this PR's commit.
@@ -551,15 +500,6 @@ func getNillableArray[T any]( | |||
return arr, nil | |||
} | |||
|
|||
func (c *collection) applyMergePatchOp( //nolint:unused |
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 believe @jsimnz wanted to keep some of these, not sure if his reason is still relevant.
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.
Nothing particularly complex has been removed (and it is not tested and possibly already broken). It is also very easy to get them back, and probably less expensive than keeping them around as 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.
😢
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.
Don't be sad John. Your code is safe in the git history 🤗
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.
0f56f36
to
19ac3e1
Compare
Is done a couple of lines up, within the switch
Oddly this was only supported type that we didnt already cover
I've mentioned this PR in the JSON Patch issue. If we need it we will be able to find it easily. |
* Remove unused functions from collection_update * Remove duplicate if Is done a couple of lines up, within the switch * Add test to cover empty update filter * Add test that updates a boolean Oddly this was only supported type that we didnt already cover * Add test for invalid update filter type
* Remove unused functions from collection_update * Remove duplicate if Is done a couple of lines up, within the switch * Add test to cover empty update filter * Add test that updates a boolean Oddly this was only supported type that we didnt already cover * Add test for invalid update filter type
Relevant issue(s)
Resolves #1044
Description
Boosts test coverage for collection_update. Does this mostly via the removal of dead code, but I also added a couple of 'quick win' tests. There are still gaps (e.g.
UpdateWith
), but it should be better.Codecov is not uploading (maybe as CI pushed the branch before PR opened), reduces the number of misses from 143 to 72.