-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xds interop: update interop client to support new tests #3737
xds interop: update interop client to support new tests #3737
Conversation
2c37ee6
to
86121dc
Compare
dbac4a0
to
78a567e
Compare
5b7cbf7
to
7bb7e8a
Compare
5eff640
to
094d304
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few nits.
interop/xds/client/client.go
Outdated
} | ||
|
||
func (watcher *statsWatcher) buildResp() *testpb.LoadBalancerStatsResponse { | ||
rpcsByType := make(map[string]*testpb.LoadBalancerStatsResponse_RpcsByPeer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, but usually a good idea: make(map[]..., len(watcher.rpcsByType))
...or, would it be better to store rpcsByType
as map[type-string]RpcsByPeer
so it doesn't need to be re-formed at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Added length.
And removed rpcType
all together.
interop/xds/client/client.go
Outdated
case "UnaryCall": | ||
ret = append(ret, unaryCall) | ||
case "EmptyCall": | ||
ret = append(ret, emptyCall) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case "UnaryCall", "EmptyCall": ret = append(ret, rpcType(r))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
interop/xds/client/client.go
Outdated
func parseRPCTypes(rpcStr string) (ret []rpcType) { | ||
rpcs := strings.Split(rpcStr, ",") | ||
if len(rpcs) == 0 { | ||
return []rpcType{"UnaryCall"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return []rpcType{unaryCall}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
interop/xds/client/client.go
Outdated
|
||
func parseRPCTypes(rpcStr string) (ret []rpcType) { | ||
rpcs := strings.Split(rpcStr, ",") | ||
if len(rpcs) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: if len(rpcStr) == 0
and move above the Split
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
interop/xds/client/client.go
Outdated
} | ||
rpcsToMD[rmSplit[0]] = append(rpcsToMD[rmSplit[0]], rmSplit[1:]...) | ||
} | ||
var ret []*rpcConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ret := make([]*rpcConfig, len(rpcs))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
interop/xds/client/client.go
Outdated
var ( | ||
p peer.Peer | ||
header metadata.MD | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are going to use a var block, maybe move it down to where err
is declared and include that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
add empty call to xds interop client/server add rpcs by type to stats rpc [xds_interop_client_rpc_metadata] xds interop client --metadata [xds_interop_client_rpc_metadata] proto doc [xds_interop_client_rpc_metadata] lint [xds_interop_client_rpc_metadata] proto field order [xds_interop_client_rpc_metadata] proto message name [xds_interop_client_rpc_metadata] by_type -> by_method
094d304
to
b8f0a0b
Compare
interop/xds/client/client.go
Outdated
|
||
func parseRPCTypes(rpcStr string) (ret []string) { | ||
if len(rpcStr) == 0 { | ||
return []string{"UnaryCall"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unaryCall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
interop/xds/client/client.go
Outdated
rpcs := strings.Split(rpcStr, ",") | ||
for _, r := range rpcs { | ||
switch r { | ||
case "UnaryCall", "EmptyCall": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case unaryCall, emptyCall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
--rpc
and--metadata
rpc_by_type