-
Notifications
You must be signed in to change notification settings - Fork 60
Fix duplicate key test case #111
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
Conversation
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 meaningful for me (but I don't know this code in fact).
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.
Hi! Thank you for the patch.
See several commits below:
- I think that "Make test case consistent with comments" is more a workaround rather than a fix. Because we have lost "Duplicate key ..." test case. But it seems ok to me. In fact, using an error message to check an error is bad practice, an error code should be used for this purpose.
- Add a description of a problem to a commit message (something like this in the issue description). This allows to understand the reason of changes in the future.
It may seems like this, so at first I wanted to add a separate test case for Duplicate error. But such test case already is covered by |
Ouch! I missed it. OK. |
c2b82c1
to
4a4e8d3
Compare
Original test case had failed with Tarantool 2.8.1 or newer due to error message rework [1]. Based on code comments and @funny-falcon response in #105, the test has been planned to be success insert test and not a duplicate key error test. This patch changes test case and asserts to its original idea. Since duplicate key test already exists in tarantool_test.go file [2], coverage should not decrease. 1. tarantool/tarantool@d11fb30 2. https://github.com/tarantool/go-tarantool/blob/61f3a41907b6bcb060e9fa07069cde5b33ba9764/tarantool_test.go#L437-L443 Closes #105
4a4e8d3
to
c806e1c
Compare
Added a description and duplicated PR commets to commits. |
@funny-falcon Aren't you mind to glance on these changes? |
Issue is described in #105. After further investigation, it was found that it was meant to be "insert structure using space name" test case that must process with success instead of "duplicate key error". Test case and corresponding output was changed to be consistent in first commit.
Before patch test case:
go-tarantool/example_test.go
Lines 121 to 125 in 61f3a41
Since there is a duplicate key error test case in another file, coverage has not decreased.
go-tarantool/tarantool_test.go
Lines 437 to 443 in 61f3a41
Closes #105