Repository navigation
test(go): add TransportEndpoints serialization tests - #5066
SouthwestAsiaFloat wants to merge 2 commits into
Conversation
|
Thanks for the PR. It is labeled If AI assistance was used to create this PR, you are required to run the Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
|
Thanks @SouthwestAsiaFloat, and welcome. As the description names ChatGPT, please run the team-review skill and post the result here. Please also confirm whether the tests pass locally, as the description says both pending and passing. |
|
All four new Codex ran the repository’s four-role
The review also noted that the failure message names |
Issue apache#5037 specifies ErrInvalidCommand for input shorter than eight bytes. Assert that error for empty and seven-byte inputs and add the required Apache license header to the test file. Co-authored-by: Codex <noreply@openai.com>
|
The four-role I reran both Go checks from
One non-blocking nit remains. The byte comparison’s failure message names The review also suggested two optional simplifications: compare the structs directly and drop the duplicate encoded-length assertion. Struct comparison · Length assertion |
Have run the team-review skill and implement modifications accordingly, please review it when you are available. Merci beaucoup |
Which issue does this PR address?
Closes #5037
Rationale
The Go SDK's
TransportEndpointspreviously lacked dedicated unit tests for binary serialization and deserialization. Existing indirect coverage did not verify port ordering, little-endian byte encoding, or handling of invalid input lengths.What changed?
The existing tests did not explicitly cover the binary layout and edge cases of
TransportEndpoints.Added unit tests to verify little-endian encoding for all four ports (TCP, QUIC, HTTP, and WebSocket), rejection of inputs shorter than 8 bytes, and correct decoding when trailing bytes are present.
Also added a round-trip test to verify serialization and deserialization consistency, along with a check that
GetBufferSize()returns 8.Local Execution
Reran the Go checks from
foreign/goatf252ab24with Go 1.25.0 on macOS (arm64).go test -count=1 -v ./...passed, including all fourTestTransportEndpointstests. The suite skipped 29 opt-in end-to-end tests because their server fixtures were not configured.go vet ./...passed with no diagnostics.Docs
AI Usage
ierror.ErrInvalidCommand, ran the local Go checks, and ran the four-role team review.