Skip to content

Commit 165576d

Browse files
committed
Skip flaky FIRCrashlyticsReportTests.m in nightlies
1 parent 32d465b commit 165576d

File tree

2 files changed

+54
-21
lines changed

2 files changed

+54
-21
lines changed

.github/workflows/crashlytics.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ concurrency:
2727

2828
jobs:
2929
spm:
30+
env:
31+
// Don't run flaky tests in nightlies.
32+
CRASHLYTICS_NIGHTLY: 1
3033
uses: ./.github/workflows/common.yml
3134
with:
3235
target: FirebaseCrashlyticsUnit

Package.swift

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -626,27 +626,7 @@ let package = Package(
626626
.swiftLanguageMode(SwiftLanguageMode.v5),
627627
]
628628
),
629-
.testTarget(
630-
name: "FirebaseCrashlyticsUnit",
631-
dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
632-
path: "Crashlytics/UnitTests",
633-
resources: [
634-
.copy("FIRCLSMachO/machO_data"),
635-
.copy("Data"),
636-
],
637-
cSettings: [
638-
.headerSearchPath("../.."),
639-
.define("DISPLAY_VERSION", to: firebaseVersion),
640-
.define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
641-
.define(
642-
"CLS_SDK_NAME",
643-
to: "Crashlytics macOS SDK",
644-
.when(platforms: [.macOS, .macCatalyst])
645-
),
646-
.define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
647-
.define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
648-
]
649-
),
629+
crashlyticsUnitTestChooser(),
650630
.target(
651631
name: "FirebaseDatabaseInternal",
652632
dependencies: [
@@ -1467,6 +1447,56 @@ func firestoreWrapperTarget() -> Target {
14671447
)
14681448
}
14691449

1450+
func crashlyticsUnitTestChooser() -> Target {
1451+
// Don't run flaky tests in nightly runs.
1452+
if Context.environment["CRASHLYTICS_NIGHTLY"] != nil {
1453+
return .testTarget(
1454+
name: "FirebaseCrashlyticsUnit",
1455+
dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
1456+
path: "Crashlytics/UnitTests",
1457+
exclude: ["FIRCrashlyticsReportTests.m"], // Flaky
1458+
resources: [
1459+
.copy("FIRCLSMachO/machO_data"),
1460+
.copy("Data"),
1461+
],
1462+
cSettings: [
1463+
.headerSearchPath("../.."),
1464+
.define("DISPLAY_VERSION", to: firebaseVersion),
1465+
.define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
1466+
.define(
1467+
"CLS_SDK_NAME",
1468+
to: "Crashlytics macOS SDK",
1469+
.when(platforms: [.macOS, .macCatalyst])
1470+
),
1471+
.define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
1472+
.define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
1473+
]
1474+
)
1475+
} else {
1476+
return .testTarget(
1477+
name: "FirebaseCrashlyticsUnit",
1478+
dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
1479+
path: "Crashlytics/UnitTests",
1480+
resources: [
1481+
.copy("FIRCLSMachO/machO_data"),
1482+
.copy("Data"),
1483+
],
1484+
cSettings: [
1485+
.headerSearchPath("../.."),
1486+
.define("DISPLAY_VERSION", to: firebaseVersion),
1487+
.define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
1488+
.define(
1489+
"CLS_SDK_NAME",
1490+
to: "Crashlytics macOS SDK",
1491+
.when(platforms: [.macOS, .macCatalyst])
1492+
),
1493+
.define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
1494+
.define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
1495+
]
1496+
)
1497+
}
1498+
}
1499+
14701500
func firestoreTargets() -> [Target] {
14711501
if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
14721502
return [

0 commit comments

Comments
 (0)