diff --git a/go.mod b/go.mod index 2b17db74..7dc7674a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module connectrpc.com/conformance go 1.20 require ( - connectrpc.com/connect v1.15.0 + connectrpc.com/connect v1.16.0 github.com/andybalholm/brotli v1.1.0 github.com/bufbuild/protoyaml-go v0.1.8 github.com/golang/snappy v0.0.4 diff --git a/go.sum b/go.sum index ff0995c0..a06fb791 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-2023110619213 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -connectrpc.com/connect v1.15.0 h1:lFdeCbZrVVDydAqwr4xGV2y+ULn+0Z73s5JBj2LikWo= -connectrpc.com/connect v1.15.0/go.mod h1:bQmjpDY8xItMnttnurVgOkHUBMRT9cpsNi2O4AjKhmA= +connectrpc.com/connect v1.16.0 h1:rdtfQjZ0OyFkWPTegBNcH7cwquGAN1WzyJy80oFNibg= +connectrpc.com/connect v1.16.0/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= diff --git a/internal/app/connectconformance/testsuites/data/connect_client_http_to_connect_code.yaml b/internal/app/connectconformance/testsuites/data/client_http_to_rpc_code.yaml similarity index 79% rename from internal/app/connectconformance/testsuites/data/connect_client_http_to_connect_code.yaml rename to internal/app/connectconformance/testsuites/data/client_http_to_rpc_code.yaml index 9754b01a..03ce0be9 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_http_to_connect_code.yaml +++ b/internal/app/connectconformance/testsuites/data/client_http_to_rpc_code.yaml @@ -1,16 +1,10 @@ -name: HTTP to Connect Code Mapping +name: HTTP to RPC Code Mapping # If a server returns a non-200 HTTP code for unary requests without an -# explicit Connect error code, the client must synthesize an RPC code +# explicit RPC error code, the client must synthesize an RPC code # from the HTTP code. These tests cases verify that mapping by forcing # the server to return a specified HTTP code and then test whether the # client correctly returns the required RPC code. -# -# TODO: Remove relevant protocols once the Connect code mapping table -# is updated to align with gRPC. -## https://github.com/connectrpc/connectrpc.com/pull/130 mode: TEST_MODE_CLIENT -relevantProtocols: - - PROTOCOL_CONNECT testCases: - request: testName: bad-request @@ -18,12 +12,11 @@ testCases: requestMessages: - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest responseDefinition: - responseData: "dGVzdCByZXNwb25zZQ==" rawResponse: statusCode: 400 expectedResponse: error: - code: CODE_INVALID_ARGUMENT + code: CODE_INTERNAL - request: testName: unauthorized streamType: STREAM_TYPE_UNARY @@ -57,17 +50,6 @@ testCases: expectedResponse: error: code: CODE_UNIMPLEMENTED -- request: - testName: request-timeout - streamType: STREAM_TYPE_UNARY - requestMessages: - - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest - responseDefinition: - rawResponse: - statusCode: 408 - expectedResponse: - error: - code: CODE_DEADLINE_EXCEEDED - request: testName: conflict streamType: STREAM_TYPE_UNARY @@ -78,7 +60,7 @@ testCases: statusCode: 409 expectedResponse: error: - code: CODE_ABORTED + code: CODE_UNKNOWN - request: testName: precondition-failed streamType: STREAM_TYPE_UNARY @@ -89,7 +71,7 @@ testCases: statusCode: 412 expectedResponse: error: - code: CODE_FAILED_PRECONDITION + code: CODE_UNKNOWN - request: testName: payload-too-large streamType: STREAM_TYPE_UNARY @@ -100,20 +82,18 @@ testCases: statusCode: 413 expectedResponse: error: - code: CODE_RESOURCE_EXHAUSTED -# TODO - uncomment when conformance is updated to the latest release of connect-go -# that includes this fix -# - request: -# testName: unsupported media type -# streamType: STREAM_TYPE_UNARY -# requestMessages: -# - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest -# responseDefinition: -# rawResponse: -# statusCode: 415 -# expectedResponse: -# error: -# code: CODE_INTERNAL + code: CODE_UNKNOWN +- request: + testName: unsupported media type + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + responseDefinition: + rawResponse: + statusCode: 415 + expectedResponse: + error: + code: CODE_UNKNOWN - request: testName: too-many-requests streamType: STREAM_TYPE_UNARY @@ -135,7 +115,7 @@ testCases: statusCode: 431 expectedResponse: error: - code: CODE_RESOURCE_EXHAUSTED + code: CODE_UNKNOWN - request: testName: bad-gateway streamType: STREAM_TYPE_UNARY @@ -169,4 +149,14 @@ testCases: expectedResponse: error: code: CODE_UNAVAILABLE - +- request: + testName: http-version-not-supported + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + responseDefinition: + rawResponse: + statusCode: 505 + expectedResponse: + error: + code: CODE_UNKNOWN diff --git a/internal/app/connectconformance/testsuites/data/connect_client_code_to_http_code.yaml b/internal/app/connectconformance/testsuites/data/connect_client_code_to_http_code.yaml index 148a3e4e..02c16ef2 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_code_to_http_code.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_client_code_to_http_code.yaml @@ -14,7 +14,7 @@ testCases: error: code: CODE_CANCELED expectedResponse: - httpStatusCode: 408 + httpStatusCode: 499 error: code: CODE_CANCELED details: @@ -71,7 +71,7 @@ testCases: error: code: CODE_DEADLINE_EXCEEDED expectedResponse: - httpStatusCode: 408 + httpStatusCode: 504 error: code: CODE_DEADLINE_EXCEEDED details: @@ -166,7 +166,7 @@ testCases: error: code: CODE_FAILED_PRECONDITION expectedResponse: - httpStatusCode: 412 + httpStatusCode: 400 error: code: CODE_FAILED_PRECONDITION details: @@ -223,7 +223,7 @@ testCases: error: code: CODE_UNIMPLEMENTED expectedResponse: - httpStatusCode: 404 + httpStatusCode: 501 error: code: CODE_UNIMPLEMENTED details: diff --git a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml index cab449bf..c7a85c22 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml @@ -22,7 +22,7 @@ testCases: text: "null" expectedResponse: error: - code: CODE_UNKNOWN + code: CODE_UNAUTHENTICATED - request: testName: error/null-code service: connectrpc.conformance.v1.ConformanceService @@ -41,7 +41,7 @@ testCases: { "code": null, "message": "oops" } expectedResponse: error: - code: CODE_UNKNOWN + code: CODE_UNAUTHENTICATED message: oops - request: testName: error/missing-code @@ -61,31 +61,28 @@ testCases: { "message": "oops" } expectedResponse: error: - code: CODE_UNKNOWN + code: CODE_UNAUTHENTICATED + message: oops + - request: + testName: error/unrecognized-code + service: connectrpc.conformance.v1.ConformanceService + method: Unary + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + responseDefinition: + rawResponse: + statusCode: 429 + headers: + - name: content-type + value: [ "application/json" ] + unary: + text: | + { "code": "foobar", "message": "oops" } + expectedResponse: + error: + code: CODE_UNAVAILABLE message: oops - -# # TODO: uncomment this once connect-go can de-serialize the -# # rest of the JSON in the face of an invalid code -# - request: -# testName: error/unrecognized-code -# 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" ] -# unary: -# text: | -# { "code": "foobar", "message": "oops" } -# expectedResponse: -# error: -# code: CODE_UNKNOWN -# message: oops - request: testName: error/allow-unrecognized-fields service: connectrpc.conformance.v1.ConformanceService @@ -251,33 +248,31 @@ testCases: error: code: CODE_UNKNOWN message: oops -# # TODO: uncomment this once connect-go can de-serialize the -# # rest of the JSON in the face of an invalid code -# - request: -# testName: end-stream/unrecognized-code -# 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" ] -# stream: -# items: -# - flags: 2 -# payload: -# text: | -# { -# "error": { "code": "foobar", "message": "oops" } -# } -# expectedResponse: -# error: -# code: CODE_UNKNOWN -# message: oops + - request: + testName: end-stream/unrecognized-code + 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" ] + stream: + items: + - flags: 2 + payload: + text: | + { + "error": { "code": "foobar", "message": "oops" } + } + expectedResponse: + error: + code: CODE_UNKNOWN + message: oops - request: testName: end-stream/allow-unrecognized-fields service: connectrpc.conformance.v1.ConformanceService diff --git a/internal/app/connectconformance/testsuites/data/connect_client_unexpected.yaml b/internal/app/connectconformance/testsuites/data/connect_client_unexpected.yaml index 478ebafb..5855bcf5 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_client_unexpected.yaml @@ -14,7 +14,7 @@ testCases: - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest responseDefinition: rawResponse: - statusCode: 412 + statusCode: 403 headers: - name: content-type value: [ "application/proto" ] @@ -22,8 +22,8 @@ testCases: binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryResponse"} expectedResponse: error: - # mapped from 412 status code (invalid body ignored) - code: CODE_FAILED_PRECONDITION + # mapped from 403 status code (invalid body ignored) + code: CODE_PERMISSION_DENIED - request: testName: client-stream/ok-but-no-response @@ -43,7 +43,7 @@ testCases: text: | { "code": "out_of_range", - "message": "oops", + "message": "oops" } expectedResponse: error: @@ -74,7 +74,7 @@ testCases: text: | { "code": "out_of_range", - "message": "oops", + "message": "oops" } expectedResponse: error: diff --git a/internal/app/connectconformance/testsuites/data/connect_server_unexpected.yaml b/internal/app/connectconformance/testsuites/data/connect_server_unexpected.yaml index 719af4b8..9b72279b 100644 --- a/internal/app/connectconformance/testsuites/data/connect_server_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_server_unexpected.yaml @@ -7,6 +7,24 @@ relevantCompressions: relevantCodecs: - CODEC_PROTO testCases: + - request: + testName: unexpected-content-type + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + rawRequest: + verb: POST + uri: /connectrpc.conformance.v1.ConformanceService/Unary + headers: + - name: content-type + value: [ "image/jpeg" ] + unary: + binary: "12345678" + expectedResponse: + httpStatusCode: 415 + error: + code: CODE_UNKNOWN + - request: testName: server-stream/no-request streamType: STREAM_TYPE_SERVER_STREAM diff --git a/internal/app/connectconformance/testsuites/data/grpc_client_unexpected.yaml b/internal/app/connectconformance/testsuites/data/grpc_client_unexpected.yaml index 2553e0d9..8a7fb1a9 100644 --- a/internal/app/connectconformance/testsuites/data/grpc_client_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/grpc_client_unexpected.yaml @@ -183,14 +183,9 @@ testCases: headers: - name: Content-Type value: [ "image/jpeg" ] - otherAllowedErrorCodes: - # Not actually specified what error code to use, but only - # internal and unknown really make any sense. There may be - # an argument for unimplemented, too. - - CODE_INTERNAL - - CODE_UNIMPLEMENTED expectedResponse: error: + # derived from 200 response code code: CODE_UNKNOWN - request: testName: unexpected-codec diff --git a/internal/app/connectconformance/testsuites/data/grpc_server_unexpected.yaml b/internal/app/connectconformance/testsuites/data/grpc_server_unexpected.yaml index c3dbe89f..50c9c060 100644 --- a/internal/app/connectconformance/testsuites/data/grpc_server_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/grpc_server_unexpected.yaml @@ -7,6 +7,31 @@ relevantCompressions: relevantCodecs: - CODEC_PROTO testCases: + - request: + testName: unexpected-content-type + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + rawRequest: + verb: POST + uri: /connectrpc.conformance.v1.ConformanceService/Unary + headers: + - name: content-type + value: [ "image/jpeg" ] + unary: + binary: "12345678" + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED + expectedResponse: + # Ideally, the server would return a 415. But it's not actually specified :/ + # httpStatusCode: 415 + error: + code: CODE_UNKNOWN + - request: testName: unary/no-request streamType: STREAM_TYPE_UNARY @@ -103,10 +128,18 @@ testCases: - flags: 0 payload: binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED expectedResponse: - httpStatusCode: 405 + # Ideally, the server would return a 405. But it's not actually specified :/ + # httpStatusCode: 405 error: code: CODE_UNKNOWN + - request: testName: unexpected-uri streamType: STREAM_TYPE_UNARY @@ -128,32 +161,33 @@ testCases: expectedResponse: error: code: CODE_UNIMPLEMENTED -## TODO: uncomment this test case once connect-go distinguishes between unknown -## (content-type that is clearly not an RPC client, can send back 415 status) -## and internal (looks like an RPC client, but unsupported codec, so send -## back RPC error response). -## https://github.com/connectrpc/connect-go/issues/689 -# - request: -# testName: unexpected codec -# streamType: STREAM_TYPE_UNARY -# requestMessages: -# - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest -# rawRequest: -# verb: POST -# uri: /connectrpc.conformance.v1.ConformanceService/Unary -# headers: -# - name: content-type -# value: [ "application/grpc+foo" ] -# - name: te -# value: [ "trailers" ] -# stream: -# items: -# - flags: 0 -# payload: -# binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} -# expectedResponse: -# error: -# code: CODE_INTERNAL + - request: + testName: unexpected codec + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + rawRequest: + verb: POST + uri: /connectrpc.conformance.v1.ConformanceService/Unary + headers: + - name: content-type + value: [ "application/grpc+foo" ] + - name: te + value: [ "trailers" ] + stream: + items: + - flags: 0 + payload: + binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED + expectedResponse: + error: + code: CODE_UNKNOWN - request: testName: unexpected-compression streamType: STREAM_TYPE_UNARY diff --git a/internal/app/connectconformance/testsuites/data/grpc_web_client_unexpected.yaml b/internal/app/connectconformance/testsuites/data/grpc_web_client_unexpected.yaml index 93b6d178..a4669158 100644 --- a/internal/app/connectconformance/testsuites/data/grpc_web_client_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/grpc_web_client_unexpected.yaml @@ -242,14 +242,9 @@ testCases: headers: - name: Content-Type value: [ "image/jpeg" ] - otherAllowedErrorCodes: - # Not actually specified what error code to use, but only - # internal and unknown really make any sense. There may be - # an argument for unimplemented, too. - - CODE_INTERNAL - - CODE_UNIMPLEMENTED expectedResponse: error: + # derived from 200 response code code: CODE_UNKNOWN - request: testName: unexpected-codec diff --git a/internal/app/connectconformance/testsuites/data/grpc_web_server_unexpected.yaml b/internal/app/connectconformance/testsuites/data/grpc_web_server_unexpected.yaml index 6b14c3f0..5fc0fb83 100644 --- a/internal/app/connectconformance/testsuites/data/grpc_web_server_unexpected.yaml +++ b/internal/app/connectconformance/testsuites/data/grpc_web_server_unexpected.yaml @@ -7,6 +7,31 @@ relevantCompressions: relevantCodecs: - CODEC_PROTO testCases: + - request: + testName: unexpected-content-type + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + rawRequest: + verb: POST + uri: /connectrpc.conformance.v1.ConformanceService/Unary + headers: + - name: content-type + value: [ "image/jpeg" ] + unary: + binary: "12345678" + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED + expectedResponse: + # Ideally, the server would return a 415. But it's not actually specified :/ + # httpStatusCode: 415 + error: + code: CODE_UNKNOWN + - request: testName: unary/no-request streamType: STREAM_TYPE_UNARY @@ -101,10 +126,18 @@ testCases: - flags: 0 payload: binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED expectedResponse: - httpStatusCode: 405 + # Ideally, the server would return a 405. But it's not actually specified :/ + # httpStatusCode: 405 error: code: CODE_UNKNOWN + - request: testName: unexpected-uri streamType: STREAM_TYPE_UNARY @@ -124,30 +157,31 @@ testCases: expectedResponse: error: code: CODE_UNIMPLEMENTED - ## TODO: uncomment this test case once connect-go distinguishes between unknown - ## (content-type that is clearly not an RPC client, can send back 415 status) - ## and internal (looks like an RPC client, but unsupported codec, so send - ## back RPC error response). - ## https://github.com/connectrpc/connect-go/issues/689 - # - request: - # testName: unexpected-codec - # streamType: STREAM_TYPE_UNARY - # requestMessages: - # - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest - # rawRequest: - # verb: POST - # uri: /connectrpc.conformance.v1.ConformanceService/Unary - # headers: - # - name: content-type - # value: [ "application/grpc-web+foo" ] - # stream: - # items: - # - flags: 0 - # payload: - # binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} - # expectedResponse: - # error: - # code: CODE_INTERNAL + - request: + testName: unexpected-codec + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + rawRequest: + verb: POST + uri: /connectrpc.conformance.v1.ConformanceService/Unary + headers: + - name: content-type + value: [ "application/grpc-web+foo" ] + stream: + items: + - flags: 0 + payload: + binary_message: { "@type": "type.googleapis.com/connectrpc.conformance.v1.UnaryRequest"} + otherAllowedErrorCodes: + # Not actually specified what error code to use, but only + # internal and unknown really make any sense. There may be + # an argument for unimplemented, too. + - CODE_INTERNAL + - CODE_UNIMPLEMENTED + expectedResponse: + error: + code: CODE_UNKNOWN - request: testName: unexpected-compression streamType: STREAM_TYPE_UNARY diff --git a/internal/app/connectconformance/testsuites/data/server_unexpected.yaml.disabled b/internal/app/connectconformance/testsuites/data/server_unexpected.yaml.disabled deleted file mode 100644 index f554d839..00000000 --- a/internal/app/connectconformance/testsuites/data/server_unexpected.yaml.disabled +++ /dev/null @@ -1,27 +0,0 @@ -# TODO: remove the ".disabled" extension from this file once Connect's HTTP -> Code -# mapping has been reconciled with gRPC. Until then, this test case fails. -# https://github.com/connectrpc/connectrpc.com/pull/130 -name: Server Unexpected Requests -mode: TEST_MODE_SERVER -relevantCompressions: - - COMPRESSION_IDENTITY -relevantCodecs: - - CODEC_PROTO -testCases: - - request: - testName: unexpected content type - streamType: STREAM_TYPE_UNARY - requestMessages: - - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest - rawRequest: - verb: POST - uri: /connectrpc.conformance.v1.ConformanceService/Unary - headers: - - name: content-type - value: [ "image/jpeg" ] - unary: - binary: "12345678" - expectedResponse: - httpStatusCode: 415 - error: - code: CODE_UNKNOWN \ No newline at end of file diff --git a/testing/grpcserver-web-known-failing.txt b/testing/grpcserver-web-known-failing.txt index c3c2f1f1..54441fe2 100644 --- a/testing/grpcserver-web-known-failing.txt +++ b/testing/grpcserver-web-known-failing.txt @@ -1,12 +1,8 @@ - # This returns 400 instead of 405. This is an inconsistency in grpc-go. - # https://github.com/grpc/grpc-go/pull/6989 - gRPC-Web Unexpected Requests/**/unexpected-verb - - # The entries for "cardinality violation" in the following doc indicate that - # these cases should fail with "unimplemented": - # https://grpc.github.io/grpc/core/md_doc_statuscodes.html - # But the grpc-go client instead fails with "unknown". - **/unary/multiple-requests - **/unary/no-request - **/server-stream/multiple-requests - **/server-stream/no-request +# The entries for "cardinality violation" in the following doc indicate that +# these cases should fail with "unimplemented": +# https://grpc.github.io/grpc/core/md_doc_statuscodes.html +# But the grpc-go client instead fails with "unknown". +**/unary/multiple-requests +**/unary/no-request +**/server-stream/multiple-requests +**/server-stream/no-request diff --git a/testing/grpcwebclient-known-failing.txt b/testing/grpcwebclient-known-failing.txt index 1e6b15a4..c1ab922e 100644 --- a/testing/grpcwebclient-known-failing.txt +++ b/testing/grpcwebclient-known-failing.txt @@ -21,3 +21,17 @@ gRPC-Web Unexpected Responses/**/unexpected-compressed-message gRPC-Web Unexpected Responses/**/unexpected-compression gRPC-Web Unexpected Responses/**/multiple-responses gRPC-Web Unexpected Responses/**/ok-but-no-response + +# The gRPC-Web client does not appear to actually implement the HTTP to gRPC status code +# mapping described in this part of the spec: +# https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md +# Instead, it always returns an "unknown" code if the response does not include a +# grpc-status header/trailer key. +HTTP to RPC Code Mapping/**/bad-gateway +HTTP to RPC Code Mapping/**/bad-request +HTTP to RPC Code Mapping/**/forbidden +HTTP to RPC Code Mapping/**/gateway-timeout +HTTP to RPC Code Mapping/**/not-found +HTTP to RPC Code Mapping/**/service-unavailable +HTTP to RPC Code Mapping/**/too-many-requests +HTTP to RPC Code Mapping/**/unauthorized diff --git a/testing/referenceclient-known-failing.txt b/testing/referenceclient-known-failing.txt index 26413120..06da45f1 100644 --- a/testing/referenceclient-known-failing.txt +++ b/testing/referenceclient-known-failing.txt @@ -1,11 +1 @@ -# Currently, connect-go returns an "internal" error when either of these occurs. -# However, the gRPC specs state that a problem with message cardinality (where -# a single message is expected but stream actually has a different number), in -# both clients and servers, should be an "unimplemented" error. -# -# Search for "cardinality violation" in this doc: -# https://grpc.github.io/grpc/core/md_doc_statuscodes.html -**/unary/multiple-responses -**/unary/ok-but-no-response -**/client-stream/multiple-responses -**/client-stream/ok-but-no-response \ No newline at end of file +# There are no known failures in the reference client. \ No newline at end of file diff --git a/testing/referenceserver-known-failing.txt b/testing/referenceserver-known-failing.txt index 54441fe2..3ba96496 100644 --- a/testing/referenceserver-known-failing.txt +++ b/testing/referenceserver-known-failing.txt @@ -1,8 +1 @@ -# The entries for "cardinality violation" in the following doc indicate that -# these cases should fail with "unimplemented": -# https://grpc.github.io/grpc/core/md_doc_statuscodes.html -# But the grpc-go client instead fails with "unknown". -**/unary/multiple-requests -**/unary/no-request -**/server-stream/multiple-requests -**/server-stream/no-request +# There are no known failures in the reference server. \ No newline at end of file