From 74686ce7c4354020b4e48ba067ac7635d0e4edb2 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 9 Jun 2016 15:33:33 -0700 Subject: Completed interop spec, as well as code for c++ --- src/proto/grpc/testing/messages.proto | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index e1090156ab..99b75dea3d 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -38,9 +38,6 @@ package grpc.testing; enum PayloadType { // Compressable text format. COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; } // A block of data, to simply increase gRPC message size. @@ -82,6 +79,12 @@ message SimpleRequest { // Whether server should return a given status EchoStatus response_status = 7; + + // Whether the server should expect this request to be compressed. + bool expect_compressed_request = 8; + + // The type of payload. + PayloadType payload_type = 9; } // Unary response, as configured by the request. @@ -100,6 +103,12 @@ message StreamingInputCallRequest { // Optional input payload sent along with the request. Payload payload = 1; + // The type of payload. + PayloadType payload_type = 2; + + // Whether the server should expect this request to be compressed. + bool expect_compressed_request = 3; + // Not expecting any payload from the response. } @@ -135,7 +144,7 @@ message StreamingOutputCallRequest { Payload payload = 3; // Whether to request the server to compress the response. - bool request_compressed_response = 6; + bool request_compressed_response = 4; // Whether server should return a given status EchoStatus response_status = 7; -- cgit v1.2.3 From dd8d84ebb576630f7114b97a6677c1983687cfb4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 10 Jun 2016 19:10:42 -0700 Subject: spec comments addressed --- doc/interop-test-descriptions.md | 212 ++++++++++++++++------------------ src/proto/grpc/testing/messages.proto | 20 ++-- 2 files changed, 106 insertions(+), 126 deletions(-) (limited to 'src') diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index ebeb62753b..3dd7807dec 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -68,14 +68,12 @@ control (even if compression is enabled on the channel). Server features: * [UnaryCall][] -* [Compressable Payload][] Procedure: 1. Client calls UnaryCall with: ``` { - response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -85,29 +83,39 @@ Procedure: Client asserts: * call was successful -* response payload type is COMPRESSABLE * 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 ### client_compressed_unary -This test verifies the client can compress unary messages. It sends two -unary requests with their payloads marked as COMPRESSABLE. One request will be -sent compressed and its `expect_compressed_request` set to true. Conversely for -the uncompressed case. +This test verifies the client can compress unary messages. It sends an initial +inconsistent request to verify whether the server supports the +[CompressedRequest][] feature. If it does, it should catch the inconsistency and +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: * [UnaryCall][] -* [Compressed Request][] +* [CompressedRequest][] 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 - response_type: COMPRESSABLE + expect_compressed: true response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -115,10 +123,11 @@ Procedure: } ``` + 1. Client calls UnaryCall with the *uncompressed* message: + ``` { - expect_compressed_request: false - response_type: COMPRESSABLE + expect_compressed: false response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -127,22 +136,18 @@ Procedure: ``` Client asserts: - * call was successful - * response payload type is COMPRESSABLE - * if `request_compressed_response` is false, the response MUST NOT have the - compressed message flag set. - * if `request_compressed_response` is true, the response MUST have the - 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 + * First call was unsuccessful with `INVALID_ARGUMENT` status. Subsequent + calls were successful. + * 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 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 -compressed or not according to the `request_compressed_response` boolean. +requests, expecting the server response to be +compressed or not according to the `response_compressed` boolean. Whether compression was actually performed is determined by the compression bit in the response's message flags. @@ -150,16 +155,14 @@ in the response's message flags. Server features: * [UnaryCall][] -* [Compressable Payload][] -* [Compressed Response][] +* [CompressedResponse][] Procedure: 1. Client calls UnaryCall with: ``` { - request_compressed_response: true - response_type: COMPRESSABLE + response_compressed: true response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -169,8 +172,7 @@ Procedure: ``` { - request_compressed_response: false - response_type: COMPRESSABLE + response_compressed: false response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -179,10 +181,9 @@ Procedure: ``` Client asserts: * call was successful - * response payload type is COMPRESSABLE - * when `request_compressed_response` is true, the response MUST have the + * when `response_compressed` is true, the response MUST have the 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. * response payload body is 314159 bytes in size * 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: * [StreamingInputCall][] -* [Compressable Payload][] Procedure: 1. Client calls StreamingInputCall @@ -245,20 +245,70 @@ Client asserts: * call was successful * 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 This test verifies that server-only streaming succeeds. Server features: * [StreamingOutputCall][] -* [Compressable Payload][] Procedure: 1. Client calls StreamingOutputCall with: ``` { - response_type:COMPRESSABLE response_parameters:{ size: 31415 } @@ -277,7 +327,6 @@ Procedure: Client asserts: * call was successful * exactly four responses -* response payloads are COMPRESSABLE * response payload bodies are sized (in order): 31415, 9, 2653, 58979 * clients are free to assert that the response payload body contents are zero 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: * [StreamingOutputCall][] -* [Compressable Payload][] -* [Compressed Response][] +* [CompressedResponse][] Procedure: @@ -297,8 +345,7 @@ Procedure: ``` { - request_compressed_response: true - response_type:COMPRESSABLE + response_compressed: true response_parameters:{ size: 31415 } @@ -310,8 +357,7 @@ Procedure: ``` { - request_compressed_response: false - response_type:COMPRESSABLE + response_compressed: false response_parameters:{ size: 31415 } @@ -324,69 +370,27 @@ Procedure: Client asserts: * call was successful * exactly two responses - * response payloads are COMPRESSABLE - * when `request_compressed_response` is false, the response's messages MUST + * when `response_compressed` is false, the response's messages MUST 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. * response payload bodies are sized (in order): 31415, 58979 * clients are free to assert that the response payload body contents are 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 This test verifies that full duplex bidi is supported. Server features: * [FullDuplexCall][] -* [Compressable Payload][] Procedure: 1. Client calls FullDuplexCall with: ``` { - response_type: COMPRESSABLE response_parameters:{ size: 31415 } @@ -400,7 +404,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_parameters:{ size: 9 } @@ -414,7 +417,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_parameters:{ size: 2653 } @@ -428,7 +430,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_parameters:{ size: 58979 } @@ -443,7 +444,6 @@ Procedure: Client asserts: * call was successful * exactly four responses -* response payloads are COMPRESSABLE * response payload bodies are sized (in order): 31415, 9, 2653, 58979 * clients are free to assert that the response payload body contents are zero and comparing the entire response messages against golden responses @@ -479,7 +479,6 @@ be passed in as `--oauth_scope`. Server features: * [UnaryCall][] -* [Compressable Payload][] * [Echo Authenticated Username][] * [Echo OAuth Scope][] @@ -489,7 +488,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -523,7 +521,6 @@ variable GOOGLE_APPLICATION_CREDENTIALS. Server features: * [UnaryCall][] -* [Compressable Payload][] * [Echo Authenticated Username][] * [Echo OAuth Scope][] @@ -533,7 +530,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -578,7 +574,6 @@ should be passed as the `--oauth_scope`. Server features: * [UnaryCall][] -* [Compressable Payload][] * [Echo Authenticated Username][] * [Echo OAuth Scope][] @@ -621,7 +616,6 @@ against grpc-test.sandbox.googleapis.com, oauth scope Server features: * [UnaryCall][] -* [Compressable Payload][] * [Echo Authenticated Username][] * [Echo OAuth Scope][] @@ -652,7 +646,6 @@ by the server. Server features: * [UnaryCall][] * [FullDuplexCall][] -* [Compressable Payload][] * [Echo Metadata][] Procedure: @@ -667,7 +660,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -686,7 +678,6 @@ Procedure: ``` { - response_type: COMPRESSABLE response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -792,14 +783,12 @@ from the server. Server features: * [FullDuplexCall][] -* [Compressable Payload][] Procedure: 1. Client starts FullDuplexCall with ``` { - response_type: COMPRESSABLE response_parameters:{ size: 31415 } @@ -946,15 +935,17 @@ for the `SimpleRequest.response_type`. If the server does not support the ### CompressedResponse [CompressedResponse]: #compressedresponse -When the client sets `SimpleRequest.request_compressed_response` to true, the -response is sent back compressed. +When the client sets `response_compressed` to true, the server's response is +sent back compressed. Note that `response_compressed` is present on both +`SimpleRequest` (unary) and `StreamingOutputCallRequest` (streaming). ### CompressedRequest [CompressedRequest]: #compressedrequest -When the client sets `SimpleRequest.expect_compressed_request ` to true, the -server expects the client request to be compressed. If it's not, it fails -the RPC with `INVALID_ARGUMENT`. +When the client sets `expect_compressed` to true, the server expects the client +request to be compressed. If it's not, it fails the RPC with `INVALID_ARGUMENT`. +Note that `response_compressed` is present on both `SimpleRequest` (unary) and +`StreamingOutputCallRequest` (streaming). ### 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 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 When the client sends a response_status in the request payload, the server closes diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 99b75dea3d..782fd40989 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -34,6 +34,7 @@ syntax = "proto3"; package grpc.testing; +// DEPRECATED, don't use. To be removed shortly. // The type of payload that should be returned. enum PayloadType { // Compressable text format. @@ -42,6 +43,7 @@ enum PayloadType { // A block of data, to simply increase gRPC message size. message Payload { + // DEPRECATED, don't use. To be removed shortly. // The type of data in body. PayloadType type = 1; // Primary contents of payload. @@ -57,12 +59,12 @@ message EchoStatus { // Unary request. message SimpleRequest { + // DEPRECATED, don't use. To be removed shortly. // Desired payload type in the response from the server. // If response_type is RANDOM, server randomly chooses one from other formats. PayloadType response_type = 1; // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. int32 response_size = 2; // Optional input payload sent along with the request. @@ -75,16 +77,13 @@ message SimpleRequest { bool fill_oauth_scope = 5; // 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 EchoStatus response_status = 7; // Whether the server should expect this request to be compressed. - bool expect_compressed_request = 8; - - // The type of payload. - PayloadType payload_type = 9; + bool expect_compressed = 8; } // Unary response, as configured by the request. @@ -103,11 +102,8 @@ message StreamingInputCallRequest { // Optional input payload sent along with the request. Payload payload = 1; - // The type of payload. - PayloadType payload_type = 2; - // 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. } @@ -121,7 +117,6 @@ message StreamingInputCallResponse { // Configuration for a particular response. message ResponseParameters { // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. int32 size = 1; // Desired interval between consecutive responses in the response stream in @@ -131,6 +126,7 @@ message ResponseParameters { // Server-streaming request. message StreamingOutputCallRequest { + // DEPRECATED, don't use. To be removed shortly. // Desired payload type in the response from the server. // 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 @@ -144,7 +140,7 @@ message StreamingOutputCallRequest { Payload payload = 3; // 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 EchoStatus response_status = 7; -- cgit v1.2.3 From 350c1517819c883f8a31b75f243e2a699d8b57a4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 14 Jun 2016 17:08:27 -0700 Subject: pr comments --- doc/interop-test-descriptions.md | 39 +++++++++++++---------------------- src/proto/grpc/testing/messages.proto | 25 +++++++++++++++------- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 3dd7807dec..480625c6ba 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -89,11 +89,10 @@ Client asserts: ### client_compressed_unary -This test verifies the client can compress unary messages. It sends an initial -inconsistent request to verify whether the server supports the -[CompressedRequest][] feature. If it does, it should catch the inconsistency and -fail the call with an `INVALID_ARGUMENT` status. If the feature is supported, it -proceeds with two unary calls, for compressed and uncompressed payloads. +This test verifies the client can compress unary messages by sending two unary +calls, for compressed and uncompressed payloads. It sends an initial probing +request to verify whether the server supports the [CompressedRequest][] feature. +If it doesn't, the call is expected to fail with an `INVALID_ARGUMENT` status. Server features: * [UnaryCall][] @@ -140,14 +139,14 @@ Procedure: calls were successful. * 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. + zeros and comparing the entire response message against a golden response. ### server_compressed_unary This test verifies the server can compress unary messages. It sends two unary -requests, expecting the server response to be -compressed or not according to the `response_compressed` boolean. +requests, expecting the server's response to be compressed or not according to +the `response_compressed` boolean. Whether compression was actually performed is determined by the compression bit in the response's message flags. @@ -158,7 +157,7 @@ Server features: * [CompressedResponse][] Procedure: - 1. Client calls UnaryCall with: + 1. Client calls UnaryCall with `SimpleRequest`s: ``` { @@ -257,7 +256,8 @@ compressed with `expect_compressed` true; the second one uncompressed with Procedure: 1. Client calls StreamingInputCall - 1. Client sends the following feature-probing *uncompressed* message + 1. Client sends the following feature-probing *uncompressed* + `StreamingInputCallRequest` message ``` { @@ -305,7 +305,7 @@ Server features: * [StreamingOutputCall][] Procedure: - 1. Client calls StreamingOutputCall with: + 1. Client calls StreamingOutputCall with `StreamingOutputCallRequest`: ``` { @@ -341,27 +341,16 @@ Server features: Procedure: - 1. Client calls StreamingOutputCall with: - - ``` - { - response_compressed: true - response_parameters:{ - size: 31415 - } - response_parameters:{ - size: 58979 - } - } - ``` + 1. Client calls StreamingOutputCall with `StreamingOutputCallRequest`: ``` { - response_compressed: false response_parameters:{ + response_compressed: true size: 31415 } response_parameters:{ + response_compressed: false size: 58979 } } diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 782fd40989..1812dc7402 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -32,6 +32,8 @@ syntax = "proto3"; +import "google/protobuf/wrappers.proto"; + package grpc.testing; // DEPRECATED, don't use. To be removed shortly. @@ -76,8 +78,11 @@ message SimpleRequest { // Whether SimpleResponse should include OAuth scope. bool fill_oauth_scope = 5; - // Whether to request the server to compress the response. - bool response_compressed = 6; + // Whether to request the server to compress the response. This field is + // "nullable" in order to interoperate seamlessly with clients not able to + // implement the full compression tests by introspecting the call to verify + // the response's compression status. + google.protobuf.BoolValue response_compressed = 6; // Whether server should return a given status EchoStatus response_status = 7; @@ -102,8 +107,11 @@ message StreamingInputCallRequest { // Optional input payload sent along with the request. Payload payload = 1; - // Whether the server should expect this request to be compressed. - bool expect_compressed = 2; + // Whether the server should expect this request to be compressed. This field + // is "nullable" in order to interoperate seamlessly with servers not able to + // implement the full compression tests by introspecting the call to verify + // the request's compression status. + BoolValue expect_compressed = 2; // Not expecting any payload from the response. } @@ -122,6 +130,12 @@ message ResponseParameters { // Desired interval between consecutive responses in the response stream in // microseconds. int32 interval_us = 2; + + // Whether to request the server to compress the response. This field is + // "nullable" in order to interoperate seamlessly with clients not able to + // implement the full compression tests by introspecting the call to verify + // the response's compression status. + BoolValue compressed = 3; } // Server-streaming request. @@ -139,9 +153,6 @@ message StreamingOutputCallRequest { // Optional input payload sent along with the request. Payload payload = 3; - // Whether to request the server to compress the response. - bool response_compressed = 6; - // Whether server should return a given status EchoStatus response_status = 7; } -- cgit v1.2.3 From c61c235fac8e2fbb1968852108f95029b67970d4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 14 Jun 2016 18:20:38 -0700 Subject: moar pr comments --- doc/interop-test-descriptions.md | 95 +++++++++++++++++++++-------------- src/proto/grpc/testing/messages.proto | 6 +-- 2 files changed, 61 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 480625c6ba..a4f9abecfa 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -90,19 +90,21 @@ Client asserts: ### client_compressed_unary This test verifies the client can compress unary messages by sending two unary -calls, for compressed and uncompressed payloads. It sends an initial probing -request to verify whether the server supports the [CompressedRequest][] feature. -If it doesn't, the call is expected to fail with an `INVALID_ARGUMENT` status. +calls, for compressed and uncompressed payloads. It also sends an initial +probing request to verify whether the server supports the [CompressedRequest][] +feature by checking if the probing call fails with an `INVALID_ARGUMENT` status. Server features: * [UnaryCall][] * [CompressedRequest][] Procedure: - 1. Client calls UnaryCall with the feature probe, an **uncompressed** message: + 1. Client calls UnaryCall with the feature probe, an *uncompressed* message: ``` { - expect_compressed: false + expect_compressed:{ + value: true + } response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -114,7 +116,9 @@ Procedure: ``` { - expect_compressed: true + expect_compressed:{ + value: true + } response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -126,7 +130,9 @@ Procedure: ``` { - expect_compressed: false + expect_compressed:{ + value: false + } response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -135,8 +141,8 @@ Procedure: ``` Client asserts: - * First call was unsuccessful with `INVALID_ARGUMENT` status. Subsequent - calls were successful. + * First call failed with `INVALID_ARGUMENT` status. + * Subsequent calls were successful. * Response payload body is 314159 bytes in size. * Clients are free to assert that the response payload body contents are zeros and comparing the entire response message against a golden response. @@ -149,7 +155,8 @@ requests, expecting the server's response to be compressed or not according to the `response_compressed` boolean. Whether compression was actually performed is determined by the compression bit -in the response's message flags. +in the response's message flags. *Note that some languages may not have access +to the message flags*. Server features: @@ -157,11 +164,13 @@ Server features: * [CompressedResponse][] Procedure: - 1. Client calls UnaryCall with `SimpleRequest`s: + 1. Client calls UnaryCall with `SimpleRequest`: ``` { - response_compressed: true + response_compressed:{ + value: true + } response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -171,7 +180,9 @@ Procedure: ``` { - response_compressed: false + response_compressed:{ + value: false + } response_size: 314159 payload:{ body: 271828 bytes of zeros @@ -184,7 +195,7 @@ Procedure: compressed message flag set. * when `response_compressed` is false, the response MUST NOT have the compressed message flag set. - * response payload body is 314159 bytes in size + * response payload body is 314159 bytes in size in both cases. * clients are free to assert that the response payload body contents are zero and comparing the entire response message against a golden response @@ -247,21 +258,20 @@ Client asserts: ### 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. +This test verifies the client can compress requests on per-message basis by +performing a two-request streaming call. It also sends an initial probing +request to verify whether the server supports the [CompressedRequest][] feature +by checking if the probing call fails with an `INVALID_ARGUMENT` status. Procedure: - 1. Client calls StreamingInputCall - 1. Client sends the following feature-probing *uncompressed* - `StreamingInputCallRequest` message + 1. Client calls `StreamingInputCall` and sends the following feature-probing + *uncompressed* `StreamingInputCallRequest` message ``` { - expect_compressed: true + expect_compressed:{ + value: true + } payload:{ body: 27182 bytes of zeros } @@ -270,31 +280,37 @@ Procedure: If the call fails with `INVALID_ARGUMENT`, the test fails. Otherwise, we continue. - 1. Client then sends the *compressed* message + 1. Client calls `StreamingInputCall` again, sending the *compressed* message ``` { - expect_compressed: true + expect_compressed:{ + value: true + } payload:{ body: 27182 bytes of zeros } } ``` - 1. And finally, the *uncompressed* message: + + 1. And finally, the *uncompressed* message ``` { - expect_compressed: false + expect_compressed:{ + value: 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. +Client asserts: +* First call fails with `INVALID_ARGUMENT`. +* Next calls succeeds. +* Response aggregated payload size is 73086. ### server_streaming @@ -333,7 +349,8 @@ Client asserts: ### server_compressed_streaming -This test verifies that the server can compress streaming messages. +This test verifies that the server can compress streaming messages and disable +compression on individual messages. Server features: * [StreamingOutputCall][] @@ -346,12 +363,16 @@ Procedure: ``` { response_parameters:{ - response_compressed: true + compressed: { + value: true + } size: 31415 } response_parameters:{ - response_compressed: false - size: 58979 + compressed: { + value: false + } + size: 92653 } } ``` @@ -363,7 +384,7 @@ Procedure: NOT have the compressed message flag set. * when `response_compressed` is true, the response's messages MUST have the compressed message flag set. - * response payload bodies are sized (in order): 31415, 58979 + * response payload bodies are sized (in order): 31415, 92653 * clients are free to assert that the response payload body contents are zero and comparing the entire response messages against golden responses diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 1812dc7402..e4e748a691 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -88,7 +88,7 @@ message SimpleRequest { EchoStatus response_status = 7; // Whether the server should expect this request to be compressed. - bool expect_compressed = 8; + google.protobuf.BoolValue expect_compressed = 8; } // Unary response, as configured by the request. @@ -111,7 +111,7 @@ message StreamingInputCallRequest { // is "nullable" in order to interoperate seamlessly with servers not able to // implement the full compression tests by introspecting the call to verify // the request's compression status. - BoolValue expect_compressed = 2; + google.protobuf.BoolValue expect_compressed = 2; // Not expecting any payload from the response. } @@ -135,7 +135,7 @@ message ResponseParameters { // "nullable" in order to interoperate seamlessly with clients not able to // implement the full compression tests by introspecting the call to verify // the response's compression status. - BoolValue compressed = 3; + google.protobuf.BoolValue compressed = 3; } // Server-streaming request. -- cgit v1.2.3 From e5f0f95101b40e00f3f7147d18514dbedf81d5a2 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 17 Jun 2016 18:56:55 -0700 Subject: fixed syntax errors in proto --- src/proto/grpc/binary_log/v1alpha/log.proto | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/proto/grpc/binary_log/v1alpha/log.proto b/src/proto/grpc/binary_log/v1alpha/log.proto index 83166cd410..46656109bc 100644 --- a/src/proto/grpc/binary_log/v1alpha/log.proto +++ b/src/proto/grpc/binary_log/v1alpha/log.proto @@ -29,20 +29,20 @@ syntax = "proto3"; -import "google/protobuf/timestamp.proto" +import "google/protobuf/timestamp.proto"; package grpc.binary_log.v1alpha; enum Direction { - SERVER_SEND; - SERVER_RECV; - CLIENT_SEND; - CLIENT_RECV; + SERVER_SEND = 0; + SERVER_RECV = 1; + CLIENT_SEND = 2; + CLIENT_RECV = 3; } message KeyValuePair { - string key; - string value; + string key = 1; + string value = 2; } // Any sort of metadata that may be sent in either direction during a call -- cgit v1.2.3 From 377bfdef920ef36ab53f409f7037f3f683020f9f Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 17 Jun 2016 18:17:47 -0700 Subject: added extra path to python protoc --- src/python/grpcio/commands.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 3e974eba0a..7f9c292d65 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -182,6 +182,8 @@ class BuildProtoModules(setuptools.Command): '--plugin=protoc-gen-python-grpc={}'.format( self.grpc_python_plugin_command), '-I {}'.format(GRPC_STEM), + '-I .'.format(GRPC_STEM), + '-I {}/third_party/protobuf/src'.format(GRPC_STEM), '--python_out={}'.format(PROTO_GEN_STEM), '--python-grpc_out={}'.format(PROTO_GEN_STEM), ] + [path] -- cgit v1.2.3 From 5ad70a6953635da45542d1b3cb93672e6b51ae64 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 17 Jun 2016 19:03:10 -0700 Subject: removed spurious .format() --- src/python/grpcio/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 7f9c292d65..f498ed4190 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -182,7 +182,7 @@ class BuildProtoModules(setuptools.Command): '--plugin=protoc-gen-python-grpc={}'.format( self.grpc_python_plugin_command), '-I {}'.format(GRPC_STEM), - '-I .'.format(GRPC_STEM), + '-I .', '-I {}/third_party/protobuf/src'.format(GRPC_STEM), '--python_out={}'.format(PROTO_GEN_STEM), '--python-grpc_out={}'.format(PROTO_GEN_STEM), -- cgit v1.2.3 From 7edfcb021f56a1fe0cf1154740cfad7a4be21cc7 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 21 Jun 2016 12:02:33 -0700 Subject: Using inlined BoolValue in lieu of wrappers.proto due to lack of node support --- src/proto/grpc/testing/messages.proto | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index e4e748a691..367752d77b 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -32,7 +32,13 @@ syntax = "proto3"; -import "google/protobuf/wrappers.proto"; +// TODO(dgq): Go back to using well-known types once +// https://github.com/grpc/grpc/issues/6980 has been fixed. +// import "google/protobuf/wrappers.proto"; +message BoolValue { + // The bool value. + bool value = 1; +} package grpc.testing; @@ -82,13 +88,13 @@ message SimpleRequest { // "nullable" in order to interoperate seamlessly with clients not able to // implement the full compression tests by introspecting the call to verify // the response's compression status. - google.protobuf.BoolValue response_compressed = 6; + BoolValue response_compressed = 6; // Whether server should return a given status EchoStatus response_status = 7; // Whether the server should expect this request to be compressed. - google.protobuf.BoolValue expect_compressed = 8; + BoolValue expect_compressed = 8; } // Unary response, as configured by the request. @@ -111,7 +117,7 @@ message StreamingInputCallRequest { // is "nullable" in order to interoperate seamlessly with servers not able to // implement the full compression tests by introspecting the call to verify // the request's compression status. - google.protobuf.BoolValue expect_compressed = 2; + BoolValue expect_compressed = 2; // Not expecting any payload from the response. } @@ -135,7 +141,7 @@ message ResponseParameters { // "nullable" in order to interoperate seamlessly with clients not able to // implement the full compression tests by introspecting the call to verify // the response's compression status. - google.protobuf.BoolValue compressed = 3; + BoolValue compressed = 3; } // Server-streaming request. -- cgit v1.2.3 From ad8723f6473034aacbfd7c0e80c0ad2b93156db8 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 21 Jun 2016 13:09:29 -0700 Subject: moved up 'package' statement. --- src/proto/grpc/testing/messages.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index 367752d77b..64998c2f23 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -32,6 +32,8 @@ syntax = "proto3"; +package grpc.testing; + // TODO(dgq): Go back to using well-known types once // https://github.com/grpc/grpc/issues/6980 has been fixed. // import "google/protobuf/wrappers.proto"; @@ -40,8 +42,6 @@ message BoolValue { bool value = 1; } -package grpc.testing; - // DEPRECATED, don't use. To be removed shortly. // The type of payload that should be returned. enum PayloadType { -- cgit v1.2.3 From e89aad02bf236190f1855d1481b5549a02cf8749 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 21 Jun 2016 16:43:31 -0700 Subject: updated node interop server --- src/node/interop/interop_server.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/node/interop/interop_server.js b/src/node/interop/interop_server.js index 7280762305..05f52a1083 100644 --- a/src/node/interop/interop_server.js +++ b/src/node/interop/interop_server.js @@ -45,9 +45,6 @@ var testProto = grpc.load({ var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial'; var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin'; -var incompressible_data = fs.readFileSync( - __dirname + '/../../../test/cpp/interop/rnd.dat'); - /** * Create a buffer filled with size zeroes * @param {number} size The length of the buffer @@ -88,15 +85,7 @@ function getEchoTrailer(call) { } function getPayload(payload_type, size) { - if (payload_type === 'RANDOM') { - payload_type = ['COMPRESSABLE', - 'UNCOMPRESSABLE'][Math.random() < 0.5 ? 0 : 1]; - } - var body; - switch (payload_type) { - case 'COMPRESSABLE': body = zeroBuffer(size); break; - case 'UNCOMPRESSABLE': incompressible_data.slice(size); break; - } + var body = zeroBuffer(size); return {type: payload_type, body: body}; } -- cgit v1.2.3