-
Notifications
You must be signed in to change notification settings - Fork 286
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
tests(dm): migrate pingcap/check to testify for pkg/binlog #7586
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 |
var ( | ||
flavor = gmysql.MySQLFlavor | ||
serverID uint32 = 101 | ||
gSetStr = "3ccc475b-2343-11e7-be21-6c0b84d59f30:1-14,406a3f61-690d-11e7-87c5-6c92bf46f384:1-94321383,53bfca22-690d-11e7-8a62-18ded7a37b78:1-495,686e1ab6-c47e-11e7-a42c-6c92bf46f384:1-34981190,03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170,10b039fc-c843-11e7-8f6a-1866daf8d810:1-308290454" | ||
gSet gmysql.GTIDSet | ||
) | ||
gSet, err := gtid.ParserGTID(flavor, gSetStr) | ||
c.Assert(err, IsNil) | ||
require.Nil(t, err) |
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.
we can use require.NoError rather than require.Nil. No big problems, you can remember it in next PR
c.Assert(events[0].Header.EventType, Equals, replication.FORMAT_DESCRIPTION_EVENT) | ||
c.Assert(events[1].Header.EventType, Equals, replication.PREVIOUS_GTIDS_EVENT) | ||
require.Nil(t, err) | ||
require.Equal(t, 2, len(events)) |
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.
require.Len(t, events, 2)
@@ -107,96 +106,97 @@ func (t *testCommonSuite) TestGenCommonGTIDEvent(c *C) { | |||
|
|||
// nil gSet, invalid | |||
gtidEv, err := GenCommonGTIDEvent(flavor, serverID, latestPos, gSet, false, 0) | |||
c.Assert(err, NotNil) | |||
c.Assert(gtidEv, IsNil) | |||
require.NotNil(t, err) |
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.
require.Error
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 24d6b6c
|
/hold lint error
unit test failed
|
dm/pkg/binlog/reader/tcp_test.go
Outdated
c.Assert(failpoint.Enable("github.com/pingcap/tiflow/dm/pkg/binlog/reader/MockTCPReaderClose", "return(true)"), IsNil) | ||
c.Assert(failpoint.Enable("github.com/pingcap/tiflow/dm/pkg/binlog/reader/MockTCPReaderGetEvent", "return(true)"), IsNil) | ||
c.Assert(failpoint.Enable("github.com/pingcap/tiflow/dm/pkg/binlog/reader/MockTCPReaderStatus", "return(true)"), IsNil) | ||
func (t *testTCPReaderSuite) SetUpSuite() { |
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.
should be SetupSuite
you can check the doc about this interface
https://pkg.go.dev/github.com/stretchr/testify/suite#SetupAllSuite
https://pkg.go.dev/github.com/stretchr/testify/suite#TearDownAllSuite
/merge |
This pull request has been accepted and is ready to merge. Commit hash: d3fa753
|
/unhold |
/merge |
@liumengya94: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
/run-engine-integration-test |
What problem does this PR solve?
migrate pingcap/check to testify for pkg/binlog
Issue Number: ref #5687
What is changed and how it works?
Use testify in dm/pkg/binlog package
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