mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
860 stars 310 forks source link

Mocked tests don’t run under Swift Package Manager #2792

Closed 1ec5 closed 3 years ago

1ec5 commented 3 years ago

2771 excluded a number of Core Navigation integration tests when implementing Swift Package Manager support. These tests depend on TestHelper, primarily to load test fixtures. We’ll probably have to break up TestHelper into at least two targets: it includes Objective-C headers and also includes some mocks that depend on MapboxNavigation, which does not yet support SPM.

Here are the affected test suites in MapboxCoreNavigationTests:

There will be other affected test suites in MapboxNavigationTests once MapboxNavigation supports SPM. Some of these test suites may need to be rewritten first due to dependencies on testing frameworks that don’t support SPM: #2791. The gap in test coverage is similar to mapbox/mapbox-directions-swift#494, but this repository’s tests don’t depend on OHHTTPStubs and don’t need to support watchOS.

/cc @mapbox/navigation-ios

1ec5 commented 3 years ago

We’ll probably have to break up TestHelper into at least two targets: it includes Objective-C headers and also includes some mocks that depend on MapboxNavigation, which does not yet support SPM.

The mocks have been removed, but MMEEventsManager+Spy.h/.m remain. We’ll need to create a CTestHelper testTarget that contains MMEEventsManager+Spy.h/.m. TestHelper would depend on CTestHelper and import it in NavigationEventsManagerSpy.swift.

ShanMa1991 commented 3 years ago

This issue is fixed by #2911