Skip to content

Commit 364041d

Browse files
authored
Update expected generated code (#64)
Motivation: grpc-swift 2.2.0 adds availability annotations to generated code. Tests are now failing because they aren't expecting the annotations. Modifications: - Update min required version - Update expectations in tests Result: Tests pass
1 parent a547cfe commit 364041d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let products: [Product] = [
3939
let dependencies: [Package.Dependency] = [
4040
.package(
4141
url: "https://github.com/grpc/grpc-swift.git",
42-
from: "2.1.0"
42+
from: "2.2.0"
4343
),
4444
.package(
4545
url: "https://github.com/apple/swift-protobuf.git",

Tests/GRPCProtobufCodeGenTests/ProtobufCodeGeneratorTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct ProtobufCodeGeneratorTests {
7070
// MARK: - test.TestService
7171
7272
/// Namespace containing generated types for the "test.TestService" service.
73+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
7374
\(access) enum Test_TestService {
7475
/// Service descriptor for the "test.TestService" service.
7576
\(access) static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "test.TestService")
@@ -133,13 +134,15 @@ struct ProtobufCodeGeneratorTests {
133134
}
134135
}
135136
137+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
136138
extension GRPCCore.ServiceDescriptor {
137139
/// Service descriptor for the "test.TestService" service.
138140
\(access) static let test_TestService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "test.TestService")
139141
}
140142
141143
// MARK: test.TestService (server)
142144
145+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
143146
extension Test_TestService {
144147
/// Streaming variant of the service protocol for the "test.TestService" service.
145148
///
@@ -401,6 +404,7 @@ struct ProtobufCodeGeneratorTests {
401404
}
402405
403406
// Default implementation of 'registerMethods(with:)'.
407+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
404408
extension Test_TestService.StreamingServiceProtocol {
405409
\(access) func registerMethods<Transport>(with router: inout GRPCCore.RPCRouter<Transport>) where Transport: GRPCCore.ServerTransport {
406410
router.registerHandler(
@@ -451,6 +455,7 @@ struct ProtobufCodeGeneratorTests {
451455
}
452456
453457
// Default implementation of streaming methods from 'StreamingServiceProtocol'.
458+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
454459
extension Test_TestService.ServiceProtocol {
455460
\(access) func unary(
456461
request: GRPCCore.StreamingServerRequest<Test_TestInput>,
@@ -487,6 +492,7 @@ struct ProtobufCodeGeneratorTests {
487492
}
488493
489494
// Default implementation of methods from 'ServiceProtocol'.
495+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
490496
extension Test_TestService.SimpleServiceProtocol {
491497
\(access) func unary(
492498
request: GRPCCore.ServerRequest<Test_TestInput>,
@@ -551,6 +557,7 @@ struct ProtobufCodeGeneratorTests {
551557
552558
// MARK: test.TestService (client)
553559
560+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
554561
extension Test_TestService {
555562
/// Generated client protocol for the "test.TestService" service.
556563
///
@@ -809,6 +816,7 @@ struct ProtobufCodeGeneratorTests {
809816
}
810817
811818
// Helpers providing default arguments to 'ClientProtocol' methods.
819+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
812820
extension Test_TestService.ClientProtocol {
813821
/// Call the "Unary" method.
814822
///
@@ -924,6 +932,7 @@ struct ProtobufCodeGeneratorTests {
924932
}
925933
926934
// Helpers providing sugared APIs for 'ClientProtocol' methods.
935+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
927936
extension Test_TestService.ClientProtocol {
928937
/// Call the "Unary" method.
929938
///

0 commit comments

Comments
 (0)