Skip to content

Commit 0506d35

Browse files
authored
Merge pull request #3741 from mapbox/azarovalex/tests-in-release-configuration
Run CI tests in Release configuration
2 parents 55e54cb + 8bb0fda commit 0506d35

File tree

174 files changed

+58
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+58
-37
lines changed

.circleci/config.yml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,6 @@ step-library:
249249
command: |
250250
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
251251
252-
- &build-Example
253-
run:
254-
name: Build Example
255-
command: |
256-
xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=14.5,name=iPhone 8 Plus' -project MapboxNavigation-SPM.xcodeproj -scheme Example clean build
257-
258252
- &trigger-metrics
259253
run:
260254
name: Trigger metrics
@@ -270,10 +264,10 @@ jobs:
270264
default: false
271265
iOS:
272266
type: string
273-
default: "14.5"
267+
default: "15.2"
274268
xcode:
275269
type: string
276-
default: "12.5.1"
270+
default: "13.2.1"
277271
lint:
278272
type: boolean
279273
default: false
@@ -301,7 +295,7 @@ jobs:
301295
condition: << parameters.update >>
302296
steps:
303297
- run: cd Tests/CocoaPodsTest/PodInstall && bundle exec pod install --repo-update
304-
- run: cd Tests/CocoaPodsTest/PodInstall && xcodebuild -workspace PodInstall.xcworkspace -scheme PodInstall -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=iPhone 8 Plus' clean build
298+
- run: cd Tests/CocoaPodsTest/PodInstall && xcodebuild -workspace PodInstall.xcworkspace -scheme PodInstall -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=iPhone 13 Pro Max' clean build
305299
- when:
306300
condition: << parameters.archive >>
307301
steps:
@@ -340,6 +334,9 @@ jobs:
340334
verify_localization:
341335
type: boolean
342336
default: true
337+
configuration:
338+
type: string
339+
default: "Debug"
343340
macos:
344341
xcode: << parameters.xcode >>
345342
environment:
@@ -374,7 +371,7 @@ jobs:
374371
xcode: << parameters.xcode >>
375372
- run:
376373
name: MapboxCoreNavigation
377-
command: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' -project MapboxNavigation.xcodeproj -scheme MapboxCoreNavigation clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
374+
command: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' -project MapboxNavigation.xcodeproj -scheme MapboxCoreNavigation -configuration << parameters.configuration >> clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >> ENABLE_TESTABILITY=YES
378375
- when:
379376
condition: << parameters.spm >>
380377
steps:
@@ -383,7 +380,7 @@ jobs:
383380
command: rm -rf *.xcodeproj
384381
- run:
385382
name: MapboxNavigation-Package
386-
command: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' -scheme MapboxNavigation-Package build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
383+
command: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' -scheme MapboxNavigation-Package -configuration << parameters.configuration >> build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >> ENABLE_TESTABILITY=YES
387384
- when:
388385
condition: << parameters.codecoverage >>
389386
steps:
@@ -393,11 +390,11 @@ jobs:
393390
- notify-build-finished
394391

395392

396-
xcode-12-examples:
393+
build-example:
397394
parameters:
398395
xcode:
399396
type: string
400-
default: "12.5.1"
397+
default: "13.2.1"
401398
spm:
402399
type: boolean
403400
default: true
@@ -410,9 +407,10 @@ jobs:
410407
- *prepare-mapbox-file
411408
- *prepare-netrc-file
412409
- *add-github-to-known-hosts
413-
- *build-Example
410+
- run:
411+
name: Build Example app
412+
command: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13 Pro Max' -project MapboxNavigation-SPM.xcodeproj -scheme Example clean build
414413
- notify-build-finished
415-
416414

417415
ios-trigger-metrics:
418416
parameters:
@@ -677,34 +675,51 @@ workflows:
677675
main-workflow:
678676
jobs:
679677
- build-job:
680-
name: "Xcode_12.5.1_iOS_14.5"
681-
xcode: "12.5.1"
682-
iOS: "14.5"
683-
device: "iPhone 12 Pro Max"
678+
name: "Xcode_13.2.1_iOS_15.2_Debug"
679+
xcode: "13.2.1"
680+
iOS: "15.2"
681+
device: "iPhone 13 Pro Max"
684682
context: Slack Orb
685683
- build-job:
686-
name: "Xcode_12.5.1_iOS_14.5_SPM"
687-
xcode: "12.5.1"
688-
iOS: "14.5"
689-
device: "iPhone 12 Pro Max"
684+
name: "Xcode_13.2.1_iOS_15.2_SPM_Debug"
685+
xcode: "13.2.1"
686+
iOS: "15.2"
687+
device: "iPhone 13 Pro Max"
688+
spm: true
689+
codecoverage: false
690+
context: Slack Orb
691+
- build-job:
692+
name: "Xcode_13.2.1_iOS_15.2_Release"
693+
xcode: "13.2.1"
694+
iOS: "15.2"
695+
device: "iPhone 13 Pro Max"
696+
context: Slack Orb
697+
configuration: "Release"
698+
- build-job:
699+
name: "Xcode_13.2.1_iOS_15.2_SPM_Release"
700+
xcode: "13.2.1"
701+
iOS: "15.2"
702+
device: "iPhone 13 Pro Max"
690703
spm: true
691704
codecoverage: false
692705
context: Slack Orb
706+
configuration: "Release"
693707
- pod-job:
694-
name: "Xcode_12.5_iOS_14.5_CP_install"
708+
name: "Xcode_13.2.1_iOS_15.2_CP_install"
695709
update: false
696-
xcode: "12.5.0"
697-
iOS: "14.5"
710+
xcode: "13.2.1"
711+
iOS: "15.2"
698712
archive: true
699713
context: Slack Orb
700714
- pod-job:
701-
name: "Xcode_12.5_iOS_14.5_CP_update"
715+
name: "Xcode_13.2.1_iOS_15.2_CP_update"
702716
update: true
703-
xcode: "12.5.0"
704-
iOS: "14.5"
717+
xcode: "13.2.1"
718+
iOS: "15.2"
705719
lint: true
706720
context: Slack Orb
707-
- xcode-12-examples:
721+
- build-example:
722+
name: "Build Example"
708723
context: Slack Orb
709724
- spm-test-job:
710725
name: "swift test; Xcode 12.5; iOS 14.5"
@@ -720,7 +735,6 @@ workflows:
720735
filters:
721736
tags:
722737
only: /^v\d+\.\d+\.\d+(-.+)?$/
723-
724738
- ios-trigger-metrics:
725739
filters:
726740
branches:

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions

Tests/MapboxNavigationTests/NavigationCameraTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class NavigationCameraTests: TestCase {
606606
XCTAssertFalse(animatorPitch.isRunning, "Pitch animator should not be running.")
607607
}
608608

609-
#if arch(x86_64)
609+
#if arch(x86_64) && DEBUG
610610
func testNavigationCameraFollowingCameraOptionsZoomRanges() {
611611
let navigationMapView = NavigationMapView(frame: .zero)
612612
guard let navigationViewportDataSource = navigationMapView.navigationCamera.viewportDataSource as? NavigationViewportDataSource else {
@@ -628,7 +628,7 @@ class NavigationCameraTests: TestCase {
628628
}
629629
#endif
630630

631-
#if arch(x86_64)
631+
#if arch(x86_64) && DEBUG
632632
// NOTE: We are running this test only on arch(x86_64) because `throwAssertion` doesn't work on ARM chips.
633633
func testNavigationCameraOverviewCameraOptionsMaximumZoomLevel() {
634634
let navigationMapView = NavigationMapView(frame: .zero)

Tests/MapboxNavigationTests/SKUTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import MapboxSpeech
66
import MapboxNavigation
77
import MapboxCommon_Private
88

9+
#if DEBUG
910
class SKUTests: TestCase {
1011
private var navigator: MapboxCoreNavigation.Navigator? = nil
1112

@@ -18,7 +19,7 @@ class SKUTests: TestCase {
1819
super.tearDown()
1920
navigator = nil
2021
}
21-
22+
2223
func testDirectionsSKU() {
2324
let expected: String = UUID().uuidString
2425
billingServiceMock.onGetSKUTokenIfValid = { _ in
@@ -66,3 +67,4 @@ class SKUTests: TestCase {
6667
XCTAssertEqual(viewController.directionsToken, skuToken)
6768
}
6869
}
70+
#endif

Tests/MapboxNavigationTests/Snapshot++.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ let snapshotDeviceName: String = {
88
.replacingOccurrences(of: ",", with: "_")
99
}()
1010

11+
let operatingSystemVersion: String = UIDevice.current.systemVersion
12+
1113
func assertImageSnapshot<Value, Format>(
1214
matching value: @autoclosure () throws -> Value,
1315
as snapshotting: Snapshotting<Value, Format>,
@@ -25,6 +27,7 @@ func assertImageSnapshot<Value, Format>(
2527
.deletingLastPathComponent()
2628
.appendingPathComponent("__Snapshots__")
2729
.appendingPathComponent(snapshotDeviceName)
30+
.appendingPathComponent(operatingSystemVersion)
2831
.appendingPathComponent(fileName)
2932

3033
let failure = verifySnapshot(

Tests/MapboxNavigationTests/TokenTestViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import MapboxNavigation
66
import MapboxDirections
77
import MapboxSpeech
88

9-
9+
#if DEBUG
1010
class TokenTestViewController: UIViewController {
1111

1212
var mapViewToken: String?
@@ -61,3 +61,4 @@ class TokenTestViewController: UIViewController {
6161
}
6262
}
6363
}
64+
#endif

Tests/MapboxNavigationTests/UserHaloCourseViewSnapshotTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ class UserHaloCourseViewSnapshotTests: TestCase {
3838

3939
XCTAssertEqual(userHaloCourseView.layer.sublayers?.count, 1, "UserHaloCourseView should contain only one layer.")
4040

41-
assertImageSnapshot(matching: userHaloCourseView, as: .image(precision: 1.00))
41+
assertImageSnapshot(matching: userHaloCourseView, as: .image(precision: 0.95))
4242

4343
userHaloCourseView.haloColor = .red
4444
userHaloCourseView.haloRingColor = .yellow
4545
userHaloCourseView.haloRadius = 20.0
4646
userHaloCourseView.haloBorderWidth = 10.0
4747

48-
assertImageSnapshot(matching: userHaloCourseView, as: .image(precision: 1.00))
48+
assertImageSnapshot(matching: userHaloCourseView, as: .image(precision: 0.95))
4949
}
5050

5151
@available(iOS 13.0, *)

0 commit comments

Comments
 (0)