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 8, 2024
1 parent 2d750b5 commit c6e16c6
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 c6e16c6

Please sign in to comment.