-
Notifications
You must be signed in to change notification settings - Fork 726
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: add ut to test the input when creating evict-leader scheduler #8768
Conversation
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/retest |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8768 +/- ##
==========================================
- Coverage 75.75% 75.64% -0.12%
==========================================
Files 461 461
Lines 72293 72298 +5
==========================================
- Hits 54767 54687 -80
- Misses 14028 14112 +84
- Partials 3498 3499 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
/retest |
@@ -113,11 +113,16 @@ func (h *schedulerHandler) CreateScheduler(w http.ResponseWriter, r *http.Reques | |||
return | |||
} | |||
case types.GrantLeaderScheduler, types.EvictLeaderScheduler: | |||
storeID, ok := input["store_id"].(float64) | |||
_, ok := input["store_id"] |
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?
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.
_, ok := input["store_id"]
represents the input("store_id") doesn't exist.
storeID, ok := input["store_id"].(float64)
represents the input("store_id") can not be convert to float.
So I split them to report different error messages.
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.
Is it necessary?
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 think we can put it here. It won't be bad at all.
/cc @lhy1024 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nolouch, rleungx 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 #4399
What is changed and how does it work?
Check List
Tests
Release note