Skip to content

Commit

Permalink
feat(deps): bump protobuf and genproto
Browse files Browse the repository at this point in the history
BREAKING CHANGE: genproto has a breaking change in the library example
protos that transitively affects this repo due to usage in the unit
tests.
  • Loading branch information
odsod committed Mar 22, 2021
1 parent f11fcc0 commit 30b758f
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
15 changes: 7 additions & 8 deletions fieldbehavior/fieldbehavior_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func TestValidateRequiredFields(t *testing.T) {
t.Parallel()
assert.NilError(t, ValidateRequiredFields(&library.Book{Name: "testbook"}))
assert.Error(t, ValidateRequiredFields(&library.Book{}), "missing required field: name")
assert.NilError(t, ValidateRequiredFields(&examplefreightv1.GetShipmentRequest{Name: "testbook"}))
assert.Error(t, ValidateRequiredFields(&examplefreightv1.GetShipmentRequest{}), "missing required field: name")
}

func TestCopyFields(t *testing.T) {
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestValidateRequiredFieldsWithMask(t *testing.T) {
assert.Error(
t,
ValidateRequiredFieldsWithMask(
&library.Book{},
&examplefreightv1.GetShipmentRequest{},
&fieldmaskpb.FieldMask{Paths: []string{"*"}},
),
"missing required field: name",
Expand All @@ -75,13 +75,12 @@ func TestValidateRequiredFieldsWithMask(t *testing.T) {
assert.Error(
t,
ValidateRequiredFieldsWithMask(
&library.UpdateBookRequest{
Name: "testname",
Book: &library.Book{},
&examplefreightv1.UpdateShipmentRequest{
Shipment: &examplefreightv1.Shipment{},
},
&fieldmaskpb.FieldMask{Paths: []string{"book.name"}},
&fieldmaskpb.FieldMask{Paths: []string{"shipment.origin_site"}},
),
"missing required field: book.name",
"missing required field: shipment.origin_site",
)
})
t.Run("missing nested not in mask", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions fieldmask/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func TestValidate(t *testing.T) {
{
name: "valid nested",
fieldMask: &fieldmaskpb.FieldMask{
Paths: []string{"name", "book.name"},
Paths: []string{"parent", "book.name"},
},
message: &library.CreateBookRequest{},
},

{
name: "invalid nested",
fieldMask: &fieldmaskpb.FieldMask{
Paths: []string{"name", "book.foo"},
Paths: []string{"parent", "book.foo"},
},
message: &library.CreateBookRequest{},
errorContains: "invalid field path: book.foo",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.15
require (
github.com/golang/protobuf v1.5.1
github.com/google/uuid v1.2.0
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.26.0
gotest.tools/v3 v3.0.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d h1:HV9Z9qMhQEsdlvxNFELgQ11RkMzO3CMkjEySjCtuLes=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6 h1:4Xw2NwItrJOFR5s6PnK98PI6Bgw1LhMP1j/rO5WP0S4=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand Down
4 changes: 2 additions & 2 deletions ordering/orderby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func TestOrderBy_ValidateForMessage(t *testing.T) {
name: "valid nested",
orderBy: OrderBy{
Fields: []Field{
{Path: "name"},
{Path: "parent"},
{Path: "book.name"},
},
},
Expand All @@ -194,7 +194,7 @@ func TestOrderBy_ValidateForMessage(t *testing.T) {
name: "invalid nested",
orderBy: OrderBy{
Fields: []Field{
{Path: "name"},
{Path: "parent"},
{Path: "book.foo"},
},
},
Expand Down
10 changes: 5 additions & 5 deletions pagination/pagetoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ func TestParseOffsetPageToken(t *testing.T) {
t.Run("valid checksums", func(t *testing.T) {
t.Parallel()
request1 := &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 10,
}
pageToken1, err := ParsePageToken(request1)
assert.NilError(t, err)
request2 := &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 20,
PageToken: pageToken1.Next(request1).String(),
}
pageToken2, err := ParsePageToken(request2)
assert.NilError(t, err)
assert.Equal(t, int64(10), pageToken2.Offset)
request3 := &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 30,
PageToken: pageToken2.Next(request2).String(),
}
Expand All @@ -38,7 +38,7 @@ func TestParseOffsetPageToken(t *testing.T) {
t.Run("invalid format", func(t *testing.T) {
t.Parallel()
request := &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 10,
PageToken: "invalid",
}
Expand All @@ -50,7 +50,7 @@ func TestParseOffsetPageToken(t *testing.T) {
t.Run("invalid checksum", func(t *testing.T) {
t.Parallel()
request := &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 10,
PageToken: EncodePageTokenStruct(&PageToken{
Offset: 100,
Expand Down
16 changes: 8 additions & 8 deletions pagination/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ func TestCalculateRequestChecksum(t *testing.T) {
{
name: "same request",
request1: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token",
},
request2: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token",
},
Expand All @@ -32,12 +32,12 @@ func TestCalculateRequestChecksum(t *testing.T) {
{
name: "different parents",
request1: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token",
},
request2: &library.ListBooksRequest{
Name: "shelves/2",
Parent: "shelves/2",
PageSize: 100,
PageToken: "token",
},
Expand All @@ -46,12 +46,12 @@ func TestCalculateRequestChecksum(t *testing.T) {
{
name: "different page sizes",
request1: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token",
},
request2: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 200,
PageToken: "token",
},
Expand All @@ -60,12 +60,12 @@ func TestCalculateRequestChecksum(t *testing.T) {
{
name: "different page tokens",
request1: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token",
},
request2: &library.ListBooksRequest{
Name: "shelves/1",
Parent: "shelves/1",
PageSize: 100,
PageToken: "token2",
},
Expand Down

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

2 changes: 1 addition & 1 deletion tools/protoc-gen-go-grpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module tools/grpc-go

go 1.14

require google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1
require google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
4 changes: 2 additions & 2 deletions tools/protoc-gen-go-grpc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1 h1:M8spwkmx0pHrPq+uMdl22w5CvJ/Y+oAJTIs9oGoCpOE=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down

0 comments on commit 30b758f

Please sign in to comment.