-
Notifications
You must be signed in to change notification settings - Fork 92
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
Mocked tests don’t run under Swift Package Manager #494
Comments
A potential workaround for this could be to remove/rename the
mkdir temp && mv MapboxMobileEvents.xcodeproj temp
xcodebuild -scheme MapboxMobileEvents test -destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
mv temp/MapboxMobileEvents.xcodeproj . && rm -rf temp Long term |
Looks like OHHTTPStubs don't have Linux support, it lacks LinuxMain.swift file, and even if I generate it, OHHTTPStubs imports OHHTTPStubs on macOS through SMP works fine, there is a minor problem with module names – when we import OHHTTPStubs through Carthage, the name of the module is import OHHTTPStubs
#if SWIFT_PACKAGE
import OHHTTPStubsSwift
#endif |
Swift Package Manager skips over several test suites that account for most of the unit tests in this repository, on all platforms, not just Linux. These tests have all been conditionally uncompiled with
!SWIFT_PACKAGE
because linksmt/OHHTTPStubs@563f48d doesn’t support Linux or SPM. We’re using this commit off a fork of OHHTTPStubs for AliSoftware/OHHTTPStubs#286, which introduces watchOS support, even though we don’t have a watchOS test target. Meanwhile, OHHTTPStubs v9.x does support both Linux and SPM.This issue affects only
swift test
on the command line, not testing within Xcode, so the primary impact is to continuous integration.mapbox/MapboxStatic.swift#109 shows that would be straightforward to upgrade to OHHTTPStubs v9.x, but that’ll require the fix in swiftlang/swift-package-manager#2817, which is in Xcode 12.2 (which is still a release candidate) or an equivalent Swift 5.3 image for Linux.
Here are the affected test suites:
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered: