Skip to content

Commit

Permalink
PR Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcairo committed Sep 11, 2024
1 parent e3dc5cf commit 0664058
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension HTTP2ClientTransport {
/// A ``GRPCCore/ClientTransport`` using HTTP/2 built on top of `NIOTransportServices`.
///
/// This transport builds on top of SwiftNIO's Transport Services networking layer and is the recommended
/// variant for use for use on Darwin-based platforms **only** (macOS, iOS, etc.).
/// variant for use for use on Darwin-based platforms (macOS, iOS, etc.).
/// If you are targeting Linux platforms then you should use the `NIOPosix` variant of
/// the ``GRPCHTTP2Core/HTTP2ClientTransport``.
///
Expand Down
19 changes: 16 additions & 3 deletions Tests/GRPCHTTP2TransportTests/HTTP2TransportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ final class HTTP2TransportTests: XCTestCase {
}

func forEachClientAndHTTPStatusCodeServer(
_ kind: [Transport.Kind] = [.posix],
_ kind: [Transport.Kind] = [.posix, .niots],
_ execute: (ControlClient, Transport.Kind) async throws -> Void
) async throws {
for clientKind in kind {
Expand Down Expand Up @@ -207,7 +207,20 @@ final class HTTP2TransportTests: XCTestCase {
)

case .niots:
fatalError("NIOTS isn't supported yet")
#if canImport(Network)
var serviceConfig = ServiceConfig()
serviceConfig.loadBalancingConfig = [.roundRobin]
transport = try HTTP2ClientTransport.TransportServices(
target: target,
config: .defaults(transportSecurity: .plaintext) {
$0.compression.algorithm = compression
$0.compression.enabledAlgorithms = enabledCompression
},
serviceConfig: serviceConfig
)
#else
throw XCTSkip("Transport not supported on this platform")
#endif
}

return GRPCClient(transport: transport)
Expand Down Expand Up @@ -1421,7 +1434,7 @@ final class HTTP2TransportTests: XCTestCase {
extension [HTTP2TransportTests.Transport] {
static let supported = [
HTTP2TransportTests.Transport(server: .posix, client: .posix),
HTTP2TransportTests.Transport(server: .niots, client: .posix),
HTTP2TransportTests.Transport(server: .niots, client: .niots),
]
}

Expand Down

0 comments on commit 0664058

Please sign in to comment.