Skip to content

Commit 2e93ed9

Browse files
author
Ignacio Bonafonte
committed
Force test span to be root spans
1 parent c1399c0 commit 2e93ed9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

DatadogSDKTesting.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,7 @@
22632263
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
22642264
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
22652265
CLANG_ENABLE_MODULES = YES;
2266+
DEVELOPMENT_TEAM = "";
22662267
INFOPLIST_FILE = Tests/Info.plist;
22672268
LD_RUNPATH_SEARCH_PATHS = (
22682269
"$(inherited)",

Sources/DatadogSDKTesting/DDTracer.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ internal class DDTracer {
113113

114114
/// launchSpanContext will only be available when running in the app launched from UITest, so assign this as the parent
115115
/// when there is no one
116-
if let launchContext = launchSpanContext, OpenTelemetrySDK.instance.contextProvider.activeSpan == nil {
116+
if let launchContext = launchSpanContext {
117117
spanBuilder.setParent(launchContext)
118+
} else {
119+
spanBuilder.setNoParent()
118120
}
119121

120122
let span = spanBuilder.startSpan()

0 commit comments

Comments
 (0)