Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ jobs:
include:
- destination: "platform=iOS Simulator"
platform: ios
device: "iPhone 16"
device: "iPhone 17"
system_prefix: "iOS"
- destination: "platform=OS X"
platform: macos
- destination: "platform=tvOS Simulator"
platform: tvos
device: "Apple TV"
device: "Apple TV 4K (3rd generation)"
system_prefix: "tvOS"
- destination: "platform=watchOS Simulator"
platform: watchos
device: "Apple Watch Ultra 2 (49mm)"
device: "Apple Watch Ultra 3 (49mm)"
system_prefix: "watchOS"

steps:
Expand Down Expand Up @@ -71,13 +71,15 @@ jobs:
-scheme ${{ env.SCHEME }}
-destination '${{ steps.select-destination.outputs.dest }}'
-quiet
SWIFT_SUPPRESS_WARNINGS=NO

- name: Test
run: >
xcodebuild test-without-building
-scheme ${{ env.SCHEME }}
-destination '${{ steps.select-destination.outputs.dest }}'
-quiet
SWIFT_SUPPRESS_WARNINGS=NO

# This allows us to have a branch protection rule for tests and deploys with matrix
status-for-matrix:
Expand Down
10 changes: 5 additions & 5 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.0
// swift-tools-version:6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -21,15 +21,15 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
.package(
url: "https://github.com/dodobrands/BlackBox",
.upToNextMajor(from: "4.0.1")
.upToNextMajor(from: "6.0.0")
),
.package(
url: "https://github.com/firebase/firebase-ios-sdk",
.upToNextMajor(from: "12.0.0")
),
.package(
url: "https://github.com/dodobrands/DBThreadSafe-ios",
.upToNextMajor(from: "2.0.0")
.upToNextMajor(from: "3.1.0")
)
],
targets: [
Expand All @@ -41,6 +41,9 @@ let package = Package(
"BlackBox",
.product(name: "FirebasePerformance", package: "firebase-ios-sdk"),
.product(name: "DBThreadSafe", package: "DBThreadSafe-ios")
],
swiftSettings: [
.treatAllWarnings(as: .error)
]
),
.testTarget(
Expand All @@ -49,6 +52,9 @@ let package = Package(
.targetItem(name: targetName, condition: nil),
"BlackBox",
.product(name: "FirebasePerformance", package: "firebase-ios-sdk")
],
swiftSettings: [
.treatAllWarnings(as: .error)
]
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class FirebasePerformanceLogger: BBLoggerProtocol {
let traceName = name(of: event, forMetric: false)
guard let trace = Performance.startTrace(name: traceName) else { return }

event.userInfo.map {
self.setMetricsOrAddAttributes(to: trace, from: $0)
if let userInfo = event.userInfo {
setMetricsOrAddAttributes(to: trace, from: userInfo)
}
incrementMetricForParentEvent(of: event)

Expand All @@ -47,8 +47,8 @@ public class FirebasePerformanceLogger: BBLoggerProtocol {

guard let trace = traces.read ({ $0[id] }) else { return }

event.userInfo.map {
self.setMetricsOrAddAttributes(to: trace, from: $0)
if let userInfo = event.userInfo {
setMetricsOrAddAttributes(to: trace, from: userInfo)
}

trace.stop()
Expand Down Expand Up @@ -164,7 +164,6 @@ extension FirebasePerformanceLogger {

#else

import Foundation
import BlackBox

@available(*, unavailable, message: "FirebasePerformanceLogger is only available on iOS and tvOS when Firebase Performance SDK is present.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import XCTest
import BlackBox
@testable import BlackBoxFirebasePerformance

class BlackBoxFirebasePerformanceTests: XCTestCase {
Expand Down