swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

adopt SwiftPM auto-discovery

Open weissi opened this issue 4 years ago • 8 comments

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

weissi avatar Aug 12 '19 15:08 weissi

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 avatar Aug 12 '19 15:08 weissi

@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.

3a4oT avatar Jan 10 '20 11:01 3a4oT

Thank you @3a4oT , I filed https://bugs.swift.org/browse/SR-12008 for this.

weissi avatar Jan 10 '20 12:01 weissi

https://github.com/apple/swift-package-manager/pull/2513

3a4oT avatar Jan 12 '20 13:01 3a4oT

Wow awesome! Thanks @3a4oT

weissi avatar Jan 12 '20 17:01 weissi

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 avatar Oct 13 '21 16:10 0xTim

@0xTim this is blocked on this: https://bugs.swift.org/browse/SR-12008 I believe.

weissi avatar Oct 13 '21 16:10 weissi

CC @tomerd

weissi avatar Oct 13 '21 16:10 weissi

This is done.

Lukasa avatar Apr 24 '23 10:04 Lukasa