You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go SDK: Add unit tests for command serialization/deserialization #2883
The Go SDK contains numerous command types that implement the MarshalBinary interface to handle binary serialization. Currently, many of these implementations lack comprehensive unit tests, which is essential for ensuring data integrity and protocol compatibility.
Task
Add unit tests to verify the correctness of the MarshalBinary implementations for all command types. The tests should ensure that the serialized output matches the expected binary format used by the Iggy server.
changed the title [-]Go SDK: Add unit tests for command serialization[/-][+]Go SDK: Add unit tests for command serialization/deserialization[/+]on Mar 10, 2026
Checked foreign/go/internal/command against the current tree. 44 command types implement MarshalBinary, and 11 of them are exercised by a test. The remaining 33 are not, grouped by the file they live in:
The ones already covered are CreateStream, UpdateStream, CreateTopic, UpdateTopic, CreateUser, UpdateUser, UpdatePermissions, LoginUser, SendMessages, PollMessages and DeleteSegments, in stream_test.go, topic_test.go, update_user_test.go, session_test.go, message_test.go and segment_test.go. Those are the pattern to copy.
One file is a self-contained piece of work, so this is worth picking up a file at a time rather than all 33 at once. system.go is the easiest start: six types, most of them taking no arguments.
Counted by matching MarshalBinary receivers against type names appearing in the _test.go files, so a type that is referenced but not actually asserted on would show as covered. Treat the 33 as a floor.
@justinmclean I started with system.go in #4305. can you check if the test style look right? I’ll also continue file by file as suggested. But for the remaining work, would you prefer one file per PR, or small groups of related files. Let me know. thanks!
Thanks @justinmclean. I’ve completed the session.go and user.go serialization tests as the next small batch. #4334
will proceed with other batches while this gets reviewed.
Thanks for checking @justinmclean. I started access_token.go locally, but I’m not ready to open a test PR ( have few things to take care before i open PR ). @p4rtridge, please go ahead with the remaining test coverage so I don’t hold up #2883. I won’t open an overlapping test PR.
Activity
[-]Go SDK Add unit tests for command serialization[/-][+]Go SDK: Add unit tests for command serialization[/+][-]Go SDK: Add unit tests for command serialization[/-][+]Go SDK: Add unit tests for command serialization/deserialization[/+]saie-ch commentedon Mar 11, 2026
@mmodzelewski, please assign this to me. I'd like to work on this.
justinmclean commentedon Sep 13, 2026
@saie-ch are you still working on this? If not I'll unassign it so someone else can pick it up.
saie-ch commentedon Sep 14, 2026
@justinmclean please unassign :)
justinmclean commentedon Sep 21, 2026
Checked
foreign/go/internal/commandagainst the current tree. 44 command types implementMarshalBinary, and 11 of them are exercised by a test. The remaining 33 are not, grouped by the file they live in:access_token.go:CreatePersonalAccessToken,DeletePersonalAccessToken,GetPersonalAccessTokensconsumer_group.go:CreateConsumerGroup,DeleteConsumerGroup,GetConsumerGroup,GetConsumerGroups,JoinConsumerGroup,LeaveConsumerGroup,SyncConsumerGroupoffset.go:DeleteConsumerOffset,GetConsumerOffset,StoreConsumerOffsetRequestpartition.go:CreatePartitions,DeletePartitionssession.go:LoginWithPersonalAccessToken,LogoutUserstream.go:DeleteStream,GetStream,GetStreamssystem.go:DescribeOptions,GetClient,GetClients,GetClusterMetadata,GetStats,Pingtopic.go:DeleteTopic,GetTopic,GetTopicsuser.go:ChangePassword,DeleteUser,GetUser,GetUsersThe ones already covered are
CreateStream,UpdateStream,CreateTopic,UpdateTopic,CreateUser,UpdateUser,UpdatePermissions,LoginUser,SendMessages,PollMessagesandDeleteSegments, instream_test.go,topic_test.go,update_user_test.go,session_test.go,message_test.goandsegment_test.go. Those are the pattern to copy.One file is a self-contained piece of work, so this is worth picking up a file at a time rather than all 33 at once.
system.gois the easiest start: six types, most of them taking no arguments.Counted by matching
MarshalBinaryreceivers against type names appearing in the_test.gofiles, so a type that is referenced but not actually asserted on would show as covered. Treat the 33 as a floor.goutamadwant commentedon Sep 26, 2026
@justinmclean pls assign this to me. thanks!
justinmclean commentedon Sep 26, 2026
Thanks @goutamadwant all yours
goutamadwant commentedon Sep 26, 2026
@justinmclean I started with
system.goin #4305. can you check if the test style look right? I’ll also continue file by file as suggested. But for the remaining work, would you prefer one file per PR, or small groups of related files. Let me know. thanks!justinmclean commentedon Sep 28, 2026
small groups of related files seem the easiest to review I think
goutamadwant commentedon Sep 29, 2026
Thanks @justinmclean. I’ve completed the
session.goanduser.goserialization tests as the next small batch. #4334will proceed with other batches while this gets reviewed.
test(go): cover offset, partition, and consumer group command seriali…
p4rtridge commentedon Oct 17, 2026
Hi @justinmclean @goutamadwant Could I also be assigned to this issue? Thanks.
justinmclean commentedon Oct 22, 2026
@goutamadwant only access_token.go is left without tests. Are you doing that one, or can @p4rtridge take it?
p4rtridge commentedon Oct 22, 2026
Yeah, I'm happy to add it if @goutamadwant haven't started on it yet.
goutamadwant commentedon Oct 22, 2026
Thanks for checking @justinmclean. I started
access_token.golocally, but I’m not ready to open a test PR ( have few things to take care before i open PR ). @p4rtridge, please go ahead with the remaining test coverage so I don’t hold up #2883. I won’t open an overlapping test PR.justinmclean commentedon Oct 22, 2026
@p4rtridge thanks, go ahead with access_token.go. I have added you as an assignee alongside goutamadwant.
p4rtridge commentedon Oct 25, 2026
Thank you, @justinmclean. I have completed the serialization tests for
access_token.goand opened #4640 for review.