Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Sources/GRPCInteropTests/InteroperabilityTestCases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,18 @@ class ClientCompressedUnary: InteroperabilityTest {
}

// With compression expected and enabled.
options.compression = .gzip

try await testServiceClient.unaryCall(
request: ClientRequest(message: compressedRequest),
options: options
) { response in
switch response.accepted {
case .success(let success):
try assertEqual(success.message.get().payload.body, Data(repeating: 0, count: 314_159))
case .failure:
throw AssertionFailure(message: "Response should have been accepted.")
for algorithm in [CompressionAlgorithm.gzip, .deflate] {
options.compression = algorithm
try await testServiceClient.unaryCall(
request: ClientRequest(message: compressedRequest),
options: options
) { response in
switch response.accepted {
case .success(let success):
try assertEqual(success.message.get().payload.body, Data(repeating: 0, count: 314_159))
case .failure:
throw AssertionFailure(message: "Response should have been accepted.")
}
}
}

Expand Down Expand Up @@ -266,7 +267,7 @@ class ServerCompressedUnary: InteroperabilityTest {
request: ClientRequest(message: compressedRequest)
) { response in
// We can't verify that the compression bit was set, instead we verify that the encoding header
// was sent by the server. This isn't quite the same since as it can still be set but the
// was sent by the server. This isn't quite the same as it can still be set but the
// compression may _not_ be set.
try assertTrue(response.metadata["grpc-encoding"].contains { $0 != "identity" })

Expand Down