-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
referenceclient: inspecting wire details needs to support compressed …
…error bodies and we should not bother comparing debug in error JSON if value could not be decoded
- Loading branch information
Showing
7 changed files
with
255 additions
and
39 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
...nal/app/connectconformance/testsuites/data/connect_client_compressed_error_endstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Connect Compressed Error and End-Stream | ||
mode: TEST_MODE_CLIENT | ||
relevantProtocols: | ||
- PROTOCOL_CONNECT | ||
relevantCompressions: | ||
# Ideally, we'd run this sort of test for any/all compression encodings | ||
# supported by the client. But, since it uses a raw HTTP response, we | ||
# have to hard-code the compression (raw response config doesn't allow | ||
# parameterizing the encoding). So we test with the most likely encoding | ||
# to be implemented. | ||
- COMPRESSION_GZIP | ||
relevantCodecs: | ||
- CODEC_PROTO | ||
testCases: | ||
- request: | ||
testName: error/compressed | ||
service: connectrpc.conformance.v1.ConformanceService | ||
method: Unary | ||
streamType: STREAM_TYPE_UNARY | ||
requestMessages: | ||
- "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest | ||
responseDefinition: | ||
rawResponse: | ||
statusCode: 422 | ||
headers: | ||
- name: content-type | ||
value: [ "application/json" ] | ||
- name: content-encoding | ||
value: [ "gzip" ] | ||
unary: | ||
text: | | ||
{ | ||
"code": "out_of_range", | ||
"message": "oops", | ||
"details": [ | ||
{ | ||
"type": "google.protobuf.FileDescriptorProto", | ||
"value": "Cgp0ZXN0LnByb3Rv", | ||
"debug": { "name": "test.proto" } | ||
} | ||
] | ||
} | ||
compression: COMPRESSION_GZIP | ||
expectedResponse: | ||
error: | ||
code: CODE_OUT_OF_RANGE | ||
message: oops | ||
details: | ||
- "@type": type.googleapis.com/google.protobuf.FileDescriptorProto | ||
name: "test.proto" | ||
|
||
- request: | ||
testName: end-stream/compressed | ||
service: connectrpc.conformance.v1.ConformanceService | ||
method: ServerStream | ||
streamType: STREAM_TYPE_SERVER_STREAM | ||
requestMessages: | ||
- "@type": type.googleapis.com/connectrpc.conformance.v1.ServerStreamRequest | ||
responseDefinition: | ||
rawResponse: | ||
statusCode: 200 | ||
headers: | ||
- name: content-type | ||
value: [ "application/connect+proto" ] | ||
- name: connect-content-encoding | ||
value: [ "gzip" ] | ||
stream: | ||
items: | ||
- flags: 3 | ||
payload: | ||
text: | | ||
{ | ||
"error": { | ||
"code": "out_of_range", | ||
"message": "oops", | ||
"foobar": "baz", | ||
"details": [ | ||
{ | ||
"type": "google.protobuf.FileDescriptorProto", | ||
"value": "Cgp0ZXN0LnByb3Rv", | ||
"debug": { "name": "test.proto" } | ||
} | ||
] | ||
} | ||
} | ||
compression: COMPRESSION_GZIP | ||
expectedResponse: | ||
error: | ||
code: CODE_OUT_OF_RANGE | ||
message: oops | ||
details: | ||
- "@type": type.googleapis.com/google.protobuf.FileDescriptorProto | ||
name: "test.proto" |
49 changes: 49 additions & 0 deletions
49
internal/app/connectconformance/testsuites/data/grpc_web_client_compressed_trailers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: gRPC-Web Compressed Trailers | ||
mode: TEST_MODE_CLIENT | ||
relevantProtocols: | ||
- PROTOCOL_GRPC_WEB | ||
relevantCompressions: | ||
# Ideally, we'd run this sort of test for any/all compression encodings | ||
# supported by the client. But, since it uses a raw HTTP response, we | ||
# have to hard-code the compression (raw response config doesn't allow | ||
# parameterizing the encoding). So we test with the most likely encoding | ||
# to be implemented. | ||
- COMPRESSION_GZIP | ||
relevantCodecs: | ||
- CODEC_PROTO | ||
testCases: | ||
- request: | ||
testName: trailers-in-body/compressed | ||
streamType: STREAM_TYPE_UNARY | ||
requestMessages: | ||
- "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest | ||
responseDefinition: | ||
rawResponse: | ||
status_code: 200 | ||
headers: | ||
- name: "access-control-allow-origin" | ||
value: [ "*" ] | ||
- name: "access-control-expose-headers" | ||
value: [ "*" ] | ||
- name: content-type | ||
value: [ "application/grpc-web" ] | ||
- name: grpc-encoding | ||
value: [ "gzip" ] | ||
- name: x-custom-header | ||
value: [ "foo" ] | ||
stream: | ||
items: | ||
- flags: 129 | ||
payload: | ||
text: "grpc-status: 9\r\ngrpc-message: error\r\nx-custom-trailer: bing\r\n" | ||
compression: COMPRESSION_GZIP | ||
expectedResponse: | ||
responseHeaders: | ||
- name: x-custom-header | ||
value: [ "foo" ] | ||
error: | ||
code: 9 | ||
message: error | ||
responseTrailers: | ||
- name: x-custom-trailer | ||
value: [ "bing" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.