-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Type inference issues in __allTests__FooTests
when using @MainActor
#7268
Labels
swift test
Changes impacting `swift test` tool
Comments
p4checo
referenced
this issue
in p4checo/reactiveswift-composable-architecture
Dec 13, 2022
## Changes - Disable tests that use `@MainActor` on Linux because of an issue gathering tests: https://github.com/apple/swift-corelibs-xctest/issues/424 - Remove Swift installation from SwiftPM Linux job, as Swift is already included in `ubuntu-latest` (`ubuntu-20.04`): https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime
p4checo
referenced
this issue
in p4checo/reactiveswift-composable-architecture
Dec 13, 2022
## Changes - Disable tests that use `@MainActor` on Linux because of an issue gathering tests: https://github.com/apple/swift-corelibs-xctest/issues/424 - Remove Swift installation from SwiftPM Linux job, as Swift is already included in `ubuntu-latest` (`ubuntu-20.04`): https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime
p4checo
referenced
this issue
in p4checo/reactiveswift-composable-architecture
Dec 20, 2022
## Changes - Fix unit tests. - Remove unnecessary Combine imports - Fix imports on Linux. - Fix unit tests on Linux + Add missing compile checks for `XCTExpectFailure` in Linux + Disable tests that use `@MainActor` on Linux because of an issue gathering tests: https://github.com/apple/swift-corelibs-xctest/issues/424 - Remove Swift installation from SwiftPM Linux job, as Swift is already included in `ubuntu-latest` (`ubuntu-20.04`): https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime
mluisbrown
referenced
this issue
in ReactiveCocoa/reactiveswift-composable-architecture
Dec 21, 2022
## Changes - Fix unit tests. - Remove unnecessary Combine imports - Fix imports on Linux. - Fix unit tests on Linux + Add missing compile checks for `XCTExpectFailure` in Linux + Disable tests that use `@MainActor` on Linux because of an issue gathering tests: https://github.com/apple/swift-corelibs-xctest/issues/424 - Remove Swift installation from SwiftPM Linux job, as Swift is already included in `ubuntu-latest` (`ubuntu-20.04`): https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#language-and-runtime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
While working in the ReactiveSwift port of The Composable Architecture, more specifically ensuring Linux support, the
swift test
calls started failing on the generated__allTests__FooTests
properties as can be seen below.Relevant CI run here (from ReactiveCocoa/reactiveswift-composable-architecture#58)
After some investigation I was able to narrow down the problem to the use of
@MainActor
on the test suites, which are used on the "problematic" test suites. I then proceeded to create some minimal examples that replicate the issue.As they are, the following error is triggered:
If we uncomment the commented lines, the collection literal is correctly inferred to type
[(String, (DummyTests) -> @MainActor () throws -> ())]
, but even then I'm not sure if it will work as the expected type appears to be[(String, (XCTestCase) -> () throws -> Void)]
which doesn't have@MainActor
, right?That means perhaps this means
@MainActor
is simply not supported yet as it will require new overloads/wrappers to deal with@MainActor
annotated tests, and possibly will also involve the codegen in SPM.For now I will probably disable these tests in Linux, but it would be nice to have them included. Thanks! 🙏🏼
Demo
Environment
The text was updated successfully, but these errors were encountered: