-
Notifications
You must be signed in to change notification settings - Fork 131
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
reparo/syncer: add unit test #540
Conversation
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
/run-all-tests |
/run-unit-test |
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.
rest 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
can you separate the bug fix into another pr? |
|
||
var _ = check.Suite(&testPrintSuite{}) | ||
|
||
func (s *testPrintSuite) TestPrintSyncer(c *check.C) { |
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.
It seems that these test cases are almost identical, can we create a test function that can validate all of these syncers?
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.
only validation functions are different
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.
and this case is lack of output validation
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.
define a new function to do these things 201a7cb
where is the bug? 🤔 |
if err != nil { | ||
return nil, errors.Trace(err) | ||
} | ||
_, oldDatum, err := codec.DecodeOne(col.ChangedValue) | ||
_, newDatum, err := codec.DecodeOne(col.ChangedValue) |
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 bug? ***
reparo/syncer/mysql_test.go
Outdated
dmlBinlog := &pb.Binlog{ | ||
Tp: pb.BinlogType_DML, | ||
DmlData: &pb.DMLData{ | ||
Events: generateDMLEvents(c)[0:1], |
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.
test two case Events: generateDMLEvents(c)[0:2],
?
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.
done 0bd0c15
Rest LGTM |
/run-all-tests |
LGTM |
/run-all-tests |
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
What problem does this PR solve?
add unit test for reparo/syncer
https://internal.pingcap.net/jira/browse/TOOL-1057
What is changed and how it works?
Check List
Tests
Related changes