spec comments addressed

pull/6839/head
David Garcia Quintas 9 years ago
parent 7b3fa9e54f
commit dd8d84ebb5
  1. 212
      doc/interop-test-descriptions.md
  2. 20
      src/proto/grpc/testing/messages.proto

@ -68,14 +68,12 @@ control (even if compression is enabled on the channel).
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][]
Procedure: Procedure:
1. Client calls UnaryCall with: 1. Client calls UnaryCall with:
``` ```
{ {
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -85,29 +83,39 @@ Procedure:
Client asserts: Client asserts:
* call was successful * call was successful
* response payload type is COMPRESSABLE
* response payload body is 314159 bytes in size * response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero * clients are free to assert that the response payload body contents are zero
and comparing the entire response message against a golden response and comparing the entire response message against a golden response
### client_compressed_unary ### client_compressed_unary
This test verifies the client can compress unary messages. It sends two This test verifies the client can compress unary messages. It sends an initial
unary requests with their payloads marked as COMPRESSABLE. One request will be inconsistent request to verify whether the server supports the
sent compressed and its `expect_compressed_request` set to true. Conversely for [CompressedRequest][] feature. If it does, it should catch the inconsistency and
the uncompressed case. fail the call with an `INVALID_ARGUMENT` status. If the feature is supported, it
proceeds with two unary calls, for compressed and uncompressed payloads.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressed Request][] * [CompressedRequest][]
Procedure: Procedure:
1. Client calls UnaryCall with: 1. Client calls UnaryCall with the feature probe, an **uncompressed** message:
```
{
expect_compressed: false
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
1. Client calls UnaryCall with the *compressed* message:
``` ```
{ {
expect_compressed_request: true expect_compressed: true
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -115,10 +123,11 @@ Procedure:
} }
``` ```
1. Client calls UnaryCall with the *uncompressed* message:
``` ```
{ {
expect_compressed_request: false expect_compressed: false
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -127,22 +136,18 @@ Procedure:
``` ```
Client asserts: Client asserts:
* call was successful * First call was unsuccessful with `INVALID_ARGUMENT` status. Subsequent
* response payload type is COMPRESSABLE calls were successful.
* if `request_compressed_response` is false, the response MUST NOT have the * Response payload body is 314159 bytes in size.
compressed message flag set. * Clients are free to assert that the response payload body contents are
* if `request_compressed_response` is true, the response MUST have the zero and comparing the entire response message against a golden response.
compressed message flag set.
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are
zero and comparing the entire response message against a golden response
### server_compressed_unary ### server_compressed_unary
This test verifies the server can compress unary messages. It sends two unary This test verifies the server can compress unary messages. It sends two unary
requests for a COMPRESSABLE payload type, expecting the server response to be requests, expecting the server response to be
compressed or not according to the `request_compressed_response` boolean. compressed or not according to the `response_compressed` boolean.
Whether compression was actually performed is determined by the compression bit Whether compression was actually performed is determined by the compression bit
in the response's message flags. in the response's message flags.
@ -150,16 +155,14 @@ in the response's message flags.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][] * [CompressedResponse][]
* [Compressed Response][]
Procedure: Procedure:
1. Client calls UnaryCall with: 1. Client calls UnaryCall with:
``` ```
{ {
request_compressed_response: true response_compressed: true
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -169,8 +172,7 @@ Procedure:
``` ```
{ {
request_compressed_response: false response_compressed: false
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -179,10 +181,9 @@ Procedure:
``` ```
Client asserts: Client asserts:
* call was successful * call was successful
* response payload type is COMPRESSABLE * when `response_compressed` is true, the response MUST have the
* when `request_compressed_response` is true, the response MUST have the
compressed message flag set. compressed message flag set.
* when `request_compressed_response` is false, the response MUST NOT have * when `response_compressed` is false, the response MUST NOT have
the compressed message flag set. the compressed message flag set.
* response payload body is 314159 bytes in size * response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are * clients are free to assert that the response payload body contents are
@ -195,7 +196,6 @@ This test verifies that client-only streaming succeeds.
Server features: Server features:
* [StreamingInputCall][] * [StreamingInputCall][]
* [Compressable Payload][]
Procedure: Procedure:
1. Client calls StreamingInputCall 1. Client calls StreamingInputCall
@ -245,20 +245,70 @@ Client asserts:
* call was successful * call was successful
* response aggregated_payload_size is 74922 * response aggregated_payload_size is 74922
### client_compressed_streaming
This test verifies the client can compress streaming messages. It sends an
initial inconsistent streaming call comprised of a single message to verify if
the server implements the [CompressedRequest][] feature. If it does, the client
will then send another streaming call, comprised of two messages: the first one
compressed with `expect_compressed` true; the second one uncompressed with
`expected_compressed` false.
Procedure:
1. Client calls StreamingInputCall
1. Client sends the following feature-probing *uncompressed* message
```
{
expect_compressed: true
payload:{
body: 27182 bytes of zeros
}
}
```
If the call fails with `INVALID_ARGUMENT`, the test fails. Otherwise, we
continue.
1. Client then sends the *compressed* message
```
{
expect_compressed: true
payload:{
body: 27182 bytes of zeros
}
}
```
1. And finally, the *uncompressed* message:
```
{
expect_compressed: false
payload:{
body: 45904 bytes of zeros
}
}
```
1. Client half-closes
Client asserts:
* First call was unsuccessful with `INVALID_ARGUMENT` status. Subsequent
calls were successful.
* Response aggregated_payload_size is 73086.
### server_streaming ### server_streaming
This test verifies that server-only streaming succeeds. This test verifies that server-only streaming succeeds.
Server features: Server features:
* [StreamingOutputCall][] * [StreamingOutputCall][]
* [Compressable Payload][]
Procedure: Procedure:
1. Client calls StreamingOutputCall with: 1. Client calls StreamingOutputCall with:
``` ```
{ {
response_type:COMPRESSABLE
response_parameters:{ response_parameters:{
size: 31415 size: 31415
} }
@ -277,7 +327,6 @@ Procedure:
Client asserts: Client asserts:
* call was successful * call was successful
* exactly four responses * exactly four responses
* response payloads are COMPRESSABLE
* response payload bodies are sized (in order): 31415, 9, 2653, 58979 * response payload bodies are sized (in order): 31415, 9, 2653, 58979
* clients are free to assert that the response payload body contents are zero * clients are free to assert that the response payload body contents are zero
and comparing the entire response messages against golden responses and comparing the entire response messages against golden responses
@ -288,8 +337,7 @@ This test verifies that the server can compress streaming messages.
Server features: Server features:
* [StreamingOutputCall][] * [StreamingOutputCall][]
* [Compressable Payload][] * [CompressedResponse][]
* [Compressed Response][]
Procedure: Procedure:
@ -297,8 +345,7 @@ Procedure:
``` ```
{ {
request_compressed_response: true response_compressed: true
response_type:COMPRESSABLE
response_parameters:{ response_parameters:{
size: 31415 size: 31415
} }
@ -310,8 +357,7 @@ Procedure:
``` ```
{ {
request_compressed_response: false response_compressed: false
response_type:COMPRESSABLE
response_parameters:{ response_parameters:{
size: 31415 size: 31415
} }
@ -324,69 +370,27 @@ Procedure:
Client asserts: Client asserts:
* call was successful * call was successful
* exactly two responses * exactly two responses
* response payloads are COMPRESSABLE * when `response_compressed` is false, the response's messages MUST
* when `request_compressed_response` is false, the response's messages MUST
NOT have the compressed message flag set. NOT have the compressed message flag set.
* when `request_compressed_response` is true, the response's messages MUST * when `response_compressed` is true, the response's messages MUST
have the compressed message flag set. have the compressed message flag set.
* response payload bodies are sized (in order): 31415, 58979 * response payload bodies are sized (in order): 31415, 58979
* clients are free to assert that the response payload body contents are * clients are free to assert that the response payload body contents are
zero and comparing the entire response messages against golden responses zero and comparing the entire response messages against golden responses
### client_compressed_streaming
This test verifies that the client can compress streaming messages.
Server features:
* [StreamingInputCall][]
* [Compressed Request][]
Procedure:
1. Client calls StreamingInputCall
1. Client sends:
```
{
expect_compressed_request: true
payload:{
body: 27182 bytes of zeros
}
}
```
1. Client then sends:
```
{
expect_compressed_request: false
payload:{
body: 45904 bytes of zeros
}
}
```
6. Client half-closes
Client asserts:
* call was successful
* response aggregated_payload_size is 73086
### ping_pong ### ping_pong
This test verifies that full duplex bidi is supported. This test verifies that full duplex bidi is supported.
Server features: Server features:
* [FullDuplexCall][] * [FullDuplexCall][]
* [Compressable Payload][]
Procedure: Procedure:
1. Client calls FullDuplexCall with: 1. Client calls FullDuplexCall with:
``` ```
{ {
response_type: COMPRESSABLE
response_parameters:{ response_parameters:{
size: 31415 size: 31415
} }
@ -400,7 +404,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_parameters:{ response_parameters:{
size: 9 size: 9
} }
@ -414,7 +417,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_parameters:{ response_parameters:{
size: 2653 size: 2653
} }
@ -428,7 +430,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_parameters:{ response_parameters:{
size: 58979 size: 58979
} }
@ -443,7 +444,6 @@ Procedure:
Client asserts: Client asserts:
* call was successful * call was successful
* exactly four responses * exactly four responses
* response payloads are COMPRESSABLE
* response payload bodies are sized (in order): 31415, 9, 2653, 58979 * response payload bodies are sized (in order): 31415, 9, 2653, 58979
* clients are free to assert that the response payload body contents are zero * clients are free to assert that the response payload body contents are zero
and comparing the entire response messages against golden responses and comparing the entire response messages against golden responses
@ -479,7 +479,6 @@ be passed in as `--oauth_scope`.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][] * [Echo Authenticated Username][]
* [Echo OAuth Scope][] * [Echo OAuth Scope][]
@ -489,7 +488,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -523,7 +521,6 @@ variable GOOGLE_APPLICATION_CREDENTIALS.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][] * [Echo Authenticated Username][]
* [Echo OAuth Scope][] * [Echo OAuth Scope][]
@ -533,7 +530,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -578,7 +574,6 @@ should be passed as the `--oauth_scope`.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][] * [Echo Authenticated Username][]
* [Echo OAuth Scope][] * [Echo OAuth Scope][]
@ -621,7 +616,6 @@ against grpc-test.sandbox.googleapis.com, oauth scope
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][] * [Echo Authenticated Username][]
* [Echo OAuth Scope][] * [Echo OAuth Scope][]
@ -652,7 +646,6 @@ by the server.
Server features: Server features:
* [UnaryCall][] * [UnaryCall][]
* [FullDuplexCall][] * [FullDuplexCall][]
* [Compressable Payload][]
* [Echo Metadata][] * [Echo Metadata][]
Procedure: Procedure:
@ -667,7 +660,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -686,7 +678,6 @@ Procedure:
``` ```
{ {
response_type: COMPRESSABLE
response_size: 314159 response_size: 314159
payload:{ payload:{
body: 271828 bytes of zeros body: 271828 bytes of zeros
@ -792,14 +783,12 @@ from the server.
Server features: Server features:
* [FullDuplexCall][] * [FullDuplexCall][]
* [Compressable Payload][]
Procedure: Procedure:
1. Client starts FullDuplexCall with 1. Client starts FullDuplexCall with
``` ```
{ {
response_type: COMPRESSABLE
response_parameters:{ response_parameters:{
size: 31415 size: 31415
} }
@ -946,15 +935,17 @@ for the `SimpleRequest.response_type`. If the server does not support the
### CompressedResponse ### CompressedResponse
[CompressedResponse]: #compressedresponse [CompressedResponse]: #compressedresponse
When the client sets `SimpleRequest.request_compressed_response` to true, the When the client sets `response_compressed` to true, the server's response is
response is sent back compressed. sent back compressed. Note that `response_compressed` is present on both
`SimpleRequest` (unary) and `StreamingOutputCallRequest` (streaming).
### CompressedRequest ### CompressedRequest
[CompressedRequest]: #compressedrequest [CompressedRequest]: #compressedrequest
When the client sets `SimpleRequest.expect_compressed_request ` to true, the When the client sets `expect_compressed` to true, the server expects the client
server expects the client request to be compressed. If it's not, it fails request to be compressed. If it's not, it fails the RPC with `INVALID_ARGUMENT`.
the RPC with `INVALID_ARGUMENT`. Note that `response_compressed` is present on both `SimpleRequest` (unary) and
`StreamingOutputCallRequest` (streaming).
### StreamingInputCall ### StreamingInputCall
[StreamingInputCall]: #streaminginputcall [StreamingInputCall]: #streaminginputcall
@ -982,13 +973,6 @@ payload body of size ResponseParameters.size bytes, as specified by its
respective ResponseParameters. After receiving half close and sending all respective ResponseParameters. After receiving half close and sending all
responses, it closes with OK. responses, it closes with OK.
### Compressable Payload
[Compressable Payload]: #compressable-payload
When the client requests COMPRESSABLE payload, the response includes a payload
of the size requested containing all zeros and the payload type is
COMPRESSABLE.
### Echo Status ### Echo Status
[Echo Status]: #echo-status [Echo Status]: #echo-status
When the client sends a response_status in the request payload, the server closes When the client sends a response_status in the request payload, the server closes

@ -34,6 +34,7 @@ syntax = "proto3";
package grpc.testing; package grpc.testing;
// DEPRECATED, don't use. To be removed shortly.
// The type of payload that should be returned. // The type of payload that should be returned.
enum PayloadType { enum PayloadType {
// Compressable text format. // Compressable text format.
@ -42,6 +43,7 @@ enum PayloadType {
// A block of data, to simply increase gRPC message size. // A block of data, to simply increase gRPC message size.
message Payload { message Payload {
// DEPRECATED, don't use. To be removed shortly.
// The type of data in body. // The type of data in body.
PayloadType type = 1; PayloadType type = 1;
// Primary contents of payload. // Primary contents of payload.
@ -57,12 +59,12 @@ message EchoStatus {
// Unary request. // Unary request.
message SimpleRequest { message SimpleRequest {
// DEPRECATED, don't use. To be removed shortly.
// Desired payload type in the response from the server. // Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats. // If response_type is RANDOM, server randomly chooses one from other formats.
PayloadType response_type = 1; PayloadType response_type = 1;
// Desired payload size in the response from the server. // Desired payload size in the response from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
int32 response_size = 2; int32 response_size = 2;
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
@ -75,16 +77,13 @@ message SimpleRequest {
bool fill_oauth_scope = 5; bool fill_oauth_scope = 5;
// Whether to request the server to compress the response. // Whether to request the server to compress the response.
bool request_compressed_response = 6; bool response_compressed = 6;
// Whether server should return a given status // Whether server should return a given status
EchoStatus response_status = 7; EchoStatus response_status = 7;
// Whether the server should expect this request to be compressed. // Whether the server should expect this request to be compressed.
bool expect_compressed_request = 8; bool expect_compressed = 8;
// The type of payload.
PayloadType payload_type = 9;
} }
// Unary response, as configured by the request. // Unary response, as configured by the request.
@ -103,11 +102,8 @@ message StreamingInputCallRequest {
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
Payload payload = 1; Payload payload = 1;
// The type of payload.
PayloadType payload_type = 2;
// Whether the server should expect this request to be compressed. // Whether the server should expect this request to be compressed.
bool expect_compressed_request = 3; bool expect_compressed = 2;
// Not expecting any payload from the response. // Not expecting any payload from the response.
} }
@ -121,7 +117,6 @@ message StreamingInputCallResponse {
// Configuration for a particular response. // Configuration for a particular response.
message ResponseParameters { message ResponseParameters {
// Desired payload sizes in responses from the server. // Desired payload sizes in responses from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
int32 size = 1; int32 size = 1;
// Desired interval between consecutive responses in the response stream in // Desired interval between consecutive responses in the response stream in
@ -131,6 +126,7 @@ message ResponseParameters {
// Server-streaming request. // Server-streaming request.
message StreamingOutputCallRequest { message StreamingOutputCallRequest {
// DEPRECATED, don't use. To be removed shortly.
// Desired payload type in the response from the server. // Desired payload type in the response from the server.
// If response_type is RANDOM, the payload from each response in the stream // If response_type is RANDOM, the payload from each response in the stream
// might be of different types. This is to simulate a mixed type of payload // might be of different types. This is to simulate a mixed type of payload
@ -144,7 +140,7 @@ message StreamingOutputCallRequest {
Payload payload = 3; Payload payload = 3;
// Whether to request the server to compress the response. // Whether to request the server to compress the response.
bool request_compressed_response = 4; bool response_compressed = 6;
// Whether server should return a given status // Whether server should return a given status
EchoStatus response_status = 7; EchoStatus response_status = 7;

Loading…
Cancel
Save