Skip to content

Fixes platform requirements #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ let package = Package(
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.28.0")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.1.0")),
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.30.0")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
],
targets: [
.target(name: "AWSLambdaRuntime", dependencies: [
Expand Down
6 changes: 3 additions & 3 deletions Sources/AWSLambdaRuntimeCore/LambdaHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extension LambdaHandler {

#if compiler(>=5.5)
/// Strongly typed, processing protocol for a Lambda that takes a user defined `In` and returns a user defined `Out` async.
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
public protocol AsyncLambdaHandler: EventLoopLambdaHandler {
/// The Lambda initialization method
/// Use this method to initialize resources that will be used in every request.
Expand All @@ -110,7 +110,7 @@ public protocol AsyncLambdaHandler: EventLoopLambdaHandler {
func handle(event: In, context: Lambda.Context) async throws -> Out
}

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
extension AsyncLambdaHandler {
public func handle(context: Lambda.Context, event: In) -> EventLoopFuture<Out> {
let promise = context.eventLoop.makePromise(of: Out.self)
Expand All @@ -121,7 +121,7 @@ extension AsyncLambdaHandler {
}
}

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
extension AsyncLambdaHandler {
public static func main() {
Lambda.run { context -> EventLoopFuture<ByteBufferLambdaHandler> in
Expand Down
6 changes: 3 additions & 3 deletions Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LambdaHandlerTest: XCTestCase {

// MARK: - AsyncLambdaHandler

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncHandlerSuccess() {
let server = MockLambdaServer(behavior: Behavior())
XCTAssertNoThrow(try server.start().wait())
Expand All @@ -106,7 +106,7 @@ class LambdaHandlerTest: XCTestCase {
assertLambdaLifecycleResult(result, shoudHaveRun: maxTimes)
}

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testVoidAsyncHandlerSuccess() {
let server = MockLambdaServer(behavior: Behavior(result: .success(nil)))
XCTAssertNoThrow(try server.start().wait())
Expand All @@ -127,7 +127,7 @@ class LambdaHandlerTest: XCTestCase {
assertLambdaLifecycleResult(result, shoudHaveRun: maxTimes)
}

@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncHandlerFailure() {
let server = MockLambdaServer(behavior: Behavior(result: .failure(TestError("boom"))))
XCTAssertNoThrow(try server.start().wait())
Expand Down