FlyingFox and Swift Testing

I recently adopted Swift Testing in FlyingFox for all unit tests and was really impressed with the performance:

Swift Testing
✔ Test run with 354 tests passed after 1.359 seconds.

XCTest
Executed 352 tests, with 0 failures (0 unexpected) in 7.796 (7.815) seconds

These results are from running on GitHub Actions.

:pray:t2: Thank you to the team for such a fundamental change — can't wait to see where the future goes from here.

7 Likes

I'm guessing you weren't parallelising your tests with XCTest? That would explain the huge speed up but I'd love to be proven wrong!

I wasn't but are you able to parallelise with % swift test ?

With xcodebuild parallelisation its marginally faster (5.8s) but it is also difficult to get an elapsed time output;

% xcodebuild -scheme FlyingFox-Package -destination 'platform=macOS' -parallel-testing-enabled YES test-without-building
...
xcodebuild[4830:5223951] [MT] IDETestOperationsObserverDebug: 5.868 elapsed -- Testing started completed.

To parallelize XCTest using Swift Package Manager, simply pass the --parallel option. Note that XCTest parallelizes by spawning multiple processes while Swift Testing uses Swift concurrency, so the pros and cons are different.

1 Like

using % swift test --parallel the XCTests are around 3s

1 Like

Hey, that's still more than 2x as fast. I'll take that win. :slight_smile:

4 Likes

No Objective-C for the win :laughing:

That too!