-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
unit test for go/sets/set.go #14973
unit test for go/sets/set.go #14973
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
package sets | ||
|
||
import ( | ||
"testing" | ||
|
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.
license header is missing
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.
I can edit the comments and add further test if this looks fine. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14973 +/- ##
==========================================
+ Coverage 47.38% 47.42% +0.03%
==========================================
Files 1145 1147 +2
Lines 239155 239260 +105
==========================================
+ Hits 113322 113458 +136
+ Misses 117249 117217 -32
- Partials 8584 8585 +1 ☔ View full report in Codecov by Sentry. |
go/sets/set_test.go
Outdated
compareSet.Insert(-1, -2) | ||
assert.False(t, testSet.Equal(compareSet)) | ||
|
||
//tests for Difference func |
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.
A single test should ideally test a single function. So I think this should be a bunch of separate tests and not one big test function.
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 bundled all of them since all of the functions were operations being done on a Set.
Signed-off-by: Divya Pamecha <[email protected]>
Signed-off-by: Maniaco <[email protected]>
Signed-off-by: Maniaco <[email protected]>
b825d2a
to
0ab61fa
Compare
@Its-Maniaco Looks like the |
Signed-off-by: Divya Pamecha <[email protected]>
0ab61fa
to
952c5fb
Compare
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.
The changes look good to me now! What is the test coverage for this package post the changes?
|
Signed-off-by: Manan Gupta <[email protected]>
@Its-Maniaco I have pushed a commit to make the test coverage 100%. This should be good to be merged now. Just waiting for the tests to be green. |
Partial Fix to #14931
Covers unit test for
go/sets/set.go
ok vitess.io/vitess/go/sets 0.011s coverage: 73.8% of statements