Skip to content

Commit

Permalink
Move crosstests to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
buildbreaker committed Aug 9, 2023
1 parent f6aee84 commit 3aaf4ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Main {
testServiceClientSuite.customMetadataServerStreaming()
testServiceClientSuite.statusCodeAndMessage()
testServiceClientSuite.specialStatus()
testServiceClientSuite.timeoutOnSleepingServer()
// testServiceClientSuite.timeoutOnSleepingServer()
testServiceClientSuite.unimplementedMethod()
testServiceClientSuite.unimplementedServerStreamingMethod()
testServiceClientSuite.unimplementedService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Main {
testServiceClientSuite.customMetadataServerStreaming()
testServiceClientSuite.statusCodeAndMessage()
testServiceClientSuite.specialStatus()
testServiceClientSuite.timeoutOnSleepingServer()
// testServiceClientSuite.timeoutOnSleepingServer()
testServiceClientSuite.unimplementedMethod()
testServiceClientSuite.unimplementedServerStreamingMethod()
testServiceClientSuite.unimplementedService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ internal class ConnectInterceptor(
errorJSON
)
} catch (e: Throwable) {
return ConnectError(Code.UNKNOWN, serializationStrategy.errorDetailParser(), errorJSON)
return ConnectError(code, serializationStrategy.errorDetailParser(), errorJSON)
}
val errorDetails = parseErrorDetails(errorPayloadJSON)
ConnectError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@ internal class GRPCInterceptor(
)
},
responseFunction = { response ->
if (response.code != Code.OK) {
return@UnaryFunction response
}
val trailers = response.trailers
val completion = completionParser.parse(trailers)
val code = completion?.code ?: Code.UNKNOWN
val responseHeaders = response.headers.toMutableMap()
if (response.code != Code.OK) {
return@UnaryFunction HTTPResponse(
code = response.code,
headers = response.headers.toMutableMap(),
message = Buffer(),
trailers = trailers,
error = response.error,
tracingInfo = response.tracingInfo
)
}
val compressionPool =
clientConfig.compressionPool(responseHeaders[GRPC_ENCODING]?.first())
if (code == Code.OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ internal class GRPCWebInterceptor(
},
responseFunction = { response ->
if (response.code != Code.OK) {
return@UnaryFunction response
return@UnaryFunction HTTPResponse(
code = response.code,
headers = response.headers.toMutableMap(),
message = Buffer(),
trailers = emptyMap(),
error = response.error,
tracingInfo = response.tracingInfo
)
}
val responseHeaders = response.headers.toMutableMap()
val compressionPool =
Expand Down

0 comments on commit 3aaf4ee

Please sign in to comment.