Skip to content
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

Migrate tests to Swift Testing #175

Closed
Jeehut opened this issue Jul 31, 2024 · 0 comments · Fixed by #198
Closed

Migrate tests to Swift Testing #175

Jeehut opened this issue Jul 31, 2024 · 0 comments · Fixed by #198
Assignees

Comments

@Jeehut
Copy link
Contributor

Jeehut commented Jul 31, 2024

While adjusting the tests after doing the Swift 6 migration in #174 I noticed that I couldn't get rid of the warnings in this test:

Bildschirmfoto 2024-07-31 um 16 52 33

The reason why I couldn't fix it is that I couldn't mark the LogHandlerTests file as Sendable since only classes without any inheritance or those that inherit directly from NSObject can be marked as Sendable. Now I understand why Apple was working on a new testing framework. 😆

So my suggestion is to migrate to the new Swift Testing framework, which is awesome, see the website:
https://developer.apple.com/xcode/swift-testing/

With Swift Testing, we can define test functions within struct and even enums if we want, we just need to mark the functions as @Test and Xcode will recognize them. The only potential blocker here could be that the framework seems to require Swift 6, so we might need to wait until our CI supports Xcode 16 before we can make the switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant