feat(go): add comprehensive unit tests for command serialization#2973
feat(go): add comprehensive unit tests for command serialization#2973saie-ch wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2973 +/- ##
============================================
+ Coverage 74.47% 74.49% +0.02%
Complexity 943 943
============================================
Files 1188 1188
Lines 106530 106530
Branches 83561 83561
============================================
+ Hits 79333 79360 +27
+ Misses 24448 24425 -23
+ Partials 2749 2745 -4
🚀 New features to boost your workflow:
|
atharvalade
left a comment
There was a problem hiding this comment.
overall looking good but I found a few things that need to be addressed
|
@chengxilo could you please also check this? |
There was a problem hiding this comment.
This part should not use byte(0) directly, doesn't align with the behavior in rust sdk.
iggy/core/common/src/types/permissions/permissions_global.rs
Lines 267 to 273 in 9c8b5cc
@saie-ch would you mind to solve this in another PR first (to Implement unit test for permission and fix the problem in permission)?
| @@ -43,14 +43,14 @@ func (u *UpdateUser) MarshalBinary() ([]byte, error) { | |||
| username := *u.Username | |||
There was a problem hiding this comment.
Here the u.Username is actually modified by the method, I don't think it's a good approach. Since you already modifed this method, would you mind to modified this too?
|
regarding #2973 (comment), I think it would be great to write tests to check whether they are modified after call |
|
Thanks @atharvalade and @chengxilo, I will implement the necessary changes. |
|
@saie-ch @chengxilo what's the status of this PR? is it ready to be merged? should #3015 be merged first? |
Yes please @hubcio, let's wait for that to be merged first. I just pushed new changes. |
|
This PR may still need some further review and improvement. We should merge #3015 first tho. |
|
#3015 is merged. |
|
@saie-ch @atharvalade what is the difference between this PR and #3037 ? |
This one is created a few days earlier and only covers the test for commands.🤕 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR. Thank you for your contribution! |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR. Thank you for your contribution! |
Yes, please review. I believe, i've implemented the necessary changes. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR. Thank you for your contribution! |
|
/ready |
|
@saie-ch I noticed that comments from this PR are not fixed (output from claude code): can you fix them? /author |
thanks @hubcio , will try to fix them. |
Which issue does this PR close?
Closes #2883
Rationale
The Go SDK contains numerous command types that implement the
MarshalBinaryinterface for binary serialization, but many lacked comprehensive unit tests. Without thorough testing, serialization bugs can cause data corruption, runtime panics, and wire protocol incompatibility with the Iggy server and other SDKs.What changed?
Before: Go SDK had only 6 basic tests for command serialization.
After: Added 75 new comprehensive unit tests (81 total) covering 36 commands with:
Bugs Fixed:
Test Coverage:
Local Execution
All 81 tests passed
Pre-commit hooks ran (format, tidy, generate check, vet, build)
Race detector enabled - no race conditions detected
Coverage: 75.9% in internal/command package
All pre-merge checks passed:
AI Usage
Tool: Claude Code (claude-sonnet-4.5)
Scope: Test implementation, bug discovery, and cross-SDK validation
Verification: