Skip to content

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

@1ec5

Description

@1ec5

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:

  • AnnotationTests
  • DirectionsCredentialsTests
  • DirectionsTests
  • Most of MatchTests
  • OfflineDirectionsTests
  • RoutableMatchTest
  • Most of RouteRefreshTests
  • V5Tests
  • VisualInstructionsTests

/cc @mapbox/navigation-ios

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions