apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

Add missing availability guards in tests #429

Closed simonjbeaumont closed 9 months ago

simonjbeaumont commented 9 months ago

Motivation

Some of the test code was missing availability guards for Apple platforms, resulting in build failures for these platforms, e.g.

error: 'NIOAsyncTestingChannel' is only available in iOS 13.0 or newer
         var clientChannel: NIOAsyncTestingChannel!

Modifications

Add missing availability guards. I've tried to keep them as scoped as possible. Some test suites used these as class properties, so these got a guard at suite level.

Result

Tests can now build and run on iOS and other Apple platforms.

simonjbeaumont commented 9 months ago

This looks good but there's a heap of failures from using deprecated API (as warnings as errors is enabled in CI), we should fix that up separately.

Looks like they all might be coming from one test. Added a commit which might fix it.