-
Notifications
You must be signed in to change notification settings - Fork 60
v3: add missing IPROTO feature flags to greeting negotiation #481
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
v3: add missing IPROTO feature flags to greeting negotiation #481
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.
Thank you for the patch! Please, see comments above.
Please, add an entry in the CHANGELOG.md too and squash commits into a single one:
A prefix could be conn or iproto instead of the v3.
protocol_test.go
Outdated
| iproto.IPROTO_FEATURE_IS_SYNC, // TESTING THIS | ||
| iproto.IPROTO_FEATURE_INSERT_ARROW, // TESTING THIS |
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.
| iproto.IPROTO_FEATURE_IS_SYNC, // TESTING THIS | |
| iproto.IPROTO_FEATURE_INSERT_ARROW, // TESTING THIS | |
| iproto.IPROTO_FEATURE_IS_SYNC, | |
| iproto.IPROTO_FEATURE_INSERT_ARROW, |
protocol_test.go
Outdated
|
|
||
| assert.NotNil(t, req) |
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 don't get the idea of the test. It just creates a request. What is tested here actually?
protocol_test.go
Outdated
| // Performing the mock test | ||
| protocolInfo := mockConn.ProtocolInfo() | ||
|
|
||
| // Check that the features are present | ||
| assert.Contains(t, protocolInfo.Features, iproto.IPROTO_FEATURE_IS_SYNC, | ||
| "IPROTO_FEATURE_IS_SYNC should be supported") | ||
| assert.Contains(t, protocolInfo.Features, iproto.IPROTO_FEATURE_INSERT_ARROW, | ||
| "IPROTO_FEATURE_INSERT_ARROW should be supported") | ||
|
|
||
| mockConn.AssertCalled(t, "ProtocolInfo") |
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 same here. We create a mock that returns expectedProtocolInfo and that check that expected is expected... Am I missing something?
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.
Please, remove the tests since they tests nothing.
go.sum
Outdated
| github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= | ||
| github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= |
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.
Please, revert the unnecessary changes.
go.mod
Outdated
|
|
||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/kr/text v0.2.0 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| github.com/rogpeppe/go-internal v1.14.1 // indirect | ||
| github.com/stretchr/objx v0.5.2 // indirect | ||
| github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect | ||
| golang.org/x/mod v0.27.0 // indirect | ||
| golang.org/x/sync v0.16.0 // indirect | ||
| golang.org/x/tools v0.36.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
|
|
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.
Please, revert the unnecessary changes.
dial_test.go
Outdated
| 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // Version. | ||
| 0x55, | ||
| 0x97, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Features. | ||
| 0x99, // fixed arr 9 elmnts |
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.
| 0x99, // fixed arr 9 elmnts | |
| 0x99, // Fixed array with 9 elements. |
protocol_test.go
Outdated
| /// Testing the global clientProtocolInfo from protocol.go | ||
| // To do this, we need to either make it exportable or test it through a public API | ||
|
|
||
| // Creating an IdRequest with the current clientProtocolInfo |
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.
A comment should end with a dot.
| // Creating an IdRequest with the current clientProtocolInfo | |
| // Creating an IdRequest with the current clientProtocolInfo. |
protocol_test.go
Outdated
| /// Testing the global clientProtocolInfo from protocol.go | ||
| // To do this, we need to either make it exportable or test it through a public API |
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.
etc
| /// Testing the global clientProtocolInfo from protocol.go | |
| // To do this, we need to either make it exportable or test it through a public API | |
| /// Testing the global clientProtocolInfo from protocol.go | |
| // To do this, we need to either make it exportable or test it through a public API. |
21bafd9 to
6111b79
Compare
I added flags to the greeting, wrote mock tests, fixed tests that crashed after making changes, updated the byte sequences in the map with features that are expected from the client.