-
Notifications
You must be signed in to change notification settings - Fork 289
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
api(ticdc): add /api/v2/tso: get tso from pd #5685
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
/run-verify-test |
cdc/api/v2/api.go
Outdated
) | ||
|
||
// OpenAPIV2 provides CDC v2 APIs | ||
type OpenAPIV2 struct { | ||
capture *capture.Capture | ||
// use for unit test only | ||
testStatusProvider owner.StatusProvider |
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 it's not the best way to mock the behavior of OpenAPIV2
.
We can use failpoint into the method statusProvider
, eg:
func (h *OpenAPIV2) statusProvider() owner.StatusProvider {
failpoint.Inject("mockStatusProvider", func(){
failpoint.Return(newMockStatusProvider())
})
return h.capture.StatusProvider()
}
To avoid pollute the definition of type OpenAPIV2
.
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.
Thx & Fixed. For now, I erased the dependence on StatusProvider by removal since tso_test didn't use it.
Rest LGTM |
/run-all-tests |
/run-verify-test |
1 similar comment
/run-verify-test |
/run-all-tests |
/run-integration-tests |
/run-integration-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2484f33
|
/run-verify |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #5685 +/- ##
================================================
+ Coverage 56.0768% 56.6363% +0.5594%
================================================
Files 535 679 +144
Lines 70143 79027 +8884
================================================
+ Hits 39334 44758 +5424
- Misses 27078 30067 +2989
- Partials 3731 4202 +471 |
What problem does this PR solve?
Issue Number: close #5586
What is changed and how it works?
Add API Get tso from PD to OpenAPI v2
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No
Do you need to update user documentation, design documentation or monitoring documentation?
No
Release note