swift-nio
swift-nio copied to clipboard
adopt SwiftPM auto-discovery
SwiftPM now finally supports test auto-discovery on Linux: https://twitter.com/olebegemann/status/1160846803274801152 . We should adopt. Should be as easy as deleting the Ruby and doing swift test --enable-test-discovery
Unfortunately @Lukasa just reminded me that there are a few catches here:
- to retain Swift 5.0 support we'd need to make the CI run the existing Ruby script
- if we decide to do this, we should only do it once Swift 5.1 has been released.
@weissi I tried to play with it, but I'm not sure how to be with -Xswiftc -warnings-as-errors
. The problem is that when I do (swift 5.1.3 image):
swift test --enable-test-discovery -Xswiftc -warnings-as-errors
I get something like (which is expected) :
/code/.build/x86_64-unknown-linux/debug/testlist.derived/NIOConcurrencyHelpersTests.swift:6:24: error: 'testAddSub()' is deprecated: deprecated because it tests deprecated functionality
("testAddSub", testAddSub),
With LinuxMain.swift
it's not an issue because there is a hack with protocol LinuxMainRunner { func run() }
. Maybe it worth to create a DeprecatedFunctionalityTestSuite
and move all those tests instead of hacking.
Thank you @3a4oT , I filed https://bugs.swift.org/browse/SR-12008 for this.
https://github.com/apple/swift-package-manager/pull/2513
Wow awesome! Thanks @3a4oT
Bumping this. Now that SwiftNIO supports 5.2 and later we don't have any issues with language support. I'm not sure how much the above will affect things. I stumbled across an issue when trying to write tests for async stuff. The tests needs to be marked with the macOS 12 etc availability but the script to generate the test cases doesn't pick this up leading to compiler errors after running the script. Migrating to use test discovery should solve this
@0xTim this is blocked on this: https://bugs.swift.org/browse/SR-12008 I believe.
CC @tomerd
This is done.