Skip to content

Commit

Permalink
test(proto): generate tests for AppendRequest and ReplicateRequest
Browse files Browse the repository at this point in the history
This PR adds generated tests for
`github.com/kakao/varlog/proto/snpb.AppendRequest` and
`github.com/kakao/varlog/proto/snpb.ReplicateRequest`. These tests are generated
using the [gogoproto testgen tag](https://pkg.go.dev/github.com/gogo/protobuf/plugin/testgen).

Resolving issue #795 may require changes to the unmarshaling code generated by
gogoproto. Adding these tests will provide confidence when making those changes.
  • Loading branch information
ijsong committed Jun 13, 2024
1 parent d52ff1d commit 8077cef
Show file tree
Hide file tree
Showing 8 changed files with 2,144 additions and 118 deletions.
246 changes: 190 additions & 56 deletions proto/snpb/log_io.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions proto/snpb/log_io.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ option (gogoproto.goproto_sizecache_all) = false;
// AppendRequest is a message to send a payload to a storage node. It contains
// a vector of storage nodes to replicate the payload.
message AppendRequest {
option (gogoproto.equal) = true;
option (gogoproto.populate) = true;
option (gogoproto.testgen) = true;

int32 topic_id = 1 [
(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID",
(gogoproto.customname) = "TopicID"
Expand Down
Loading

0 comments on commit 8077cef

Please sign in to comment.