-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
disttask: replace manually mock with gomock #46392
Conversation
Hi @D3Hunter. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
1 similar comment
/ok-to-test |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46392 +/- ##
================================================
- Coverage 73.3944% 72.8275% -0.5669%
================================================
Files 1295 1316 +21
Lines 393594 400659 +7065
================================================
+ Hits 288876 291790 +2914
- Misses 86351 90454 +4103
- Partials 18367 18415 +48
Flags with carried forward coverage won't be shown. Click here to find out more.
|
var wg sync.WaitGroup | ||
var taskCount int | ||
runFn := func(f func()) error { | ||
taskCount++ |
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.
seems useless?
mockPool.AssertExpectations(t) | ||
m.onRunnableTasks(context.Background(), []*proto.Task{task}) | ||
|
||
wg.Wait() | ||
} | ||
|
||
func TestManager(t *testing.T) { | ||
// TODO(gmhdbjd): use real subtask table instead of mock |
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.
remove the todo?
) | ||
|
||
func getPoolRunFn() (*sync.WaitGroup, func(f func()) error) { | ||
wg := &sync.WaitGroup{} |
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.
use util.WaitGroupWrapper
?
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.
no,current is enough
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GMHDBJD, ywqzzy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #41495
Problem Summary:
replace manually mock with mock generated by
gomock
.Note: do
make gen_mock
after any of the mocked interface changedWhat is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.