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

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

Closed
1ec5 opened this issue Jan 30, 2021 · 2 comments · Fixed by #2911
Closed

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

1ec5 opened this issue Jan 30, 2021 · 2 comments · Fixed by #2911
Assignees
Labels
Core Work related to core navigation and integrations. op-ex Refactoring, Tech Debt or any other operational excellence work.
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 30, 2021

#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:

  • LocationTests
  • MapboxCoreNavigationTests
  • MapboxNavigationServiceSpec
  • NavigationEventsManagerTests
  • NavigationServiceTests
  • OfflineRoutingTests
  • PassiveLocationDataSourceTests
  • RouteProgressTests (partial)
  • TunnelAuthorityTests

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 1ec5 added op-ex Refactoring, Tech Debt or any other operational excellence work. - tests labels Jan 30, 2021
@1ec5 1ec5 added this to the v2.0.0 milestone Jan 30, 2021
@truburt truburt modified the milestones: v2.0.0, v2.0.0 (GA) Feb 26, 2021
@truburt truburt added the Core Work related to core navigation and integrations. label Mar 2, 2021
@truburt truburt modified the milestones: v2.0.0 (GA) (iOS), v2.0.0 (GA) Mar 5, 2021
@1ec5 1ec5 modified the milestones: v2.0.0 (GA), v2.0.0 (RC) Mar 5, 2021
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 9, 2021

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
Copy link
Contributor

This issue is fixed by #2911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Work related to core navigation and integrations. op-ex Refactoring, Tech Debt or any other operational excellence work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants