gRPC Runner
The gRPC runner is used to connect to gRPC services given a proto file to dynamically create requests with
Config
The gRPC runner requires protos to be mounted to the /incoming_protos
folder
inside the runner:
volumes:
- source: /path/to/local/protos
destination: /incoming_protos
Actions
type: string
params:
proto: string
service: string
serviceAddress: string
message: dict
messages: List[dict]
metadata: List[Metadata]
compression: string
method: string
requestType: string
Returns
{
response: Union[dict, List[dict]]
metadata: [Dict[str, str]]
error: ResponseError
}
Response
Dict or list of dicts received from service on successful response
Response Error
Details about error if encountered and error code received from server
{
...
"error": {
"details": string,
"code": string
}
}
Supported Action Types
Unary
: Send one request and receive one response from serverClientStreaming
: Sends multiple messages to server and receives one responseServerStreaming
: Sends one message and receives list of responses from serverBidirectionalStreaming
: Sends and receives sequences of messages
Proto
Name of protobuf to use. For example, if the proto is named app.proto
,
the proto
field should be set to app
Service
Name of the gRPC service to use, such as Greeter
in the hello world gRPC
example
Service Address
URL of gRPC server
Message
Map to be converted into protobuf message. Note, bytes
type values should
be converted into base64 strings. For example:
base64.b64encode("my value".encode("utf-8")).decode("utf-8")
Messages
List of message body protobufs
Metadata
List of key value pairs to be sent as metadata for each message in the request:
metadata:
- key: foo
value: bar
In a response body, the metadata is compressed to a simple dict:
{
...
"metadata": {
"foo": "bar"
}
}
Compression
Compression scheme to apply to messages sent/received in the request. Valid values:
deflate
gzip
Method
Function to call service with, such as SayHello
Request Type
Protobuf structure to marshal messages into, such as HelloRequest
Asserts
type: string
params:
actionType: string
actionParams: ActionParams
expected: Expected
assertOptions: dict
Supported Assert Types
ResponseAssert
: Checks the received message body/bodiesMetadataAssert
: Checks the metadataErrorAssert
: Check the error body
Expected
The expected message body(s), metadata, or error
Assert Options
Keyword arguments to call assert with. See assert options