diff --git a/DatadogSDKTesting.podspec b/DatadogSDKTesting.podspec index 1b776101..a79e6f7a 100644 --- a/DatadogSDKTesting.podspec +++ b/DatadogSDKTesting.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "DatadogSDKTesting" s.module_name = "DatadogSDKTesting" - s.version = "2.2.2" + s.version = "2.2.2-beta.3" s.summary = "Swift testing framework for Datadog's CI Visibility product" s.homepage = "https://www.datadoghq.com" diff --git a/DatadogSDKTesting.xcodeproj/project.pbxproj b/DatadogSDKTesting.xcodeproj/project.pbxproj index a338309c..ae2c9858 100644 --- a/DatadogSDKTesting.xcodeproj/project.pbxproj +++ b/DatadogSDKTesting.xcodeproj/project.pbxproj @@ -3442,7 +3442,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = "-weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3470,7 +3470,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = "-weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3497,7 +3497,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = "-weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3525,7 +3525,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = "-weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3675,7 +3675,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -3747,7 +3747,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.0; LLVM_LTO = YES_THIN; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -3780,7 +3780,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = " -weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3805,7 +3805,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; OTHER_LDFLAGS = " -weak-lXCTestSwiftSupport"; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.DatadogSDKTesting; PRODUCT_NAME = DatadogSDKTesting; @@ -3874,7 +3874,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.EventsExporter; PRODUCT_NAME = EventsExporter; SKIP_INSTALL = YES; @@ -3905,7 +3905,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.EventsExporter; PRODUCT_NAME = EventsExporter; SKIP_INSTALL = YES; @@ -3938,7 +3938,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.EventsExporter; PRODUCT_NAME = EventsExporter; SDKROOT = macosx; @@ -3970,7 +3970,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = com.datadoghq.EventsExporter; PRODUCT_NAME = EventsExporter; SDKROOT = macosx; @@ -4002,7 +4002,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = "com.datadoghq.EventsExporter-tvOS"; PRODUCT_NAME = EventsExporter; SDKROOT = appletvos; @@ -4034,7 +4034,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 2.2.2; + MARKETING_VERSION = 2.2.2-beta.3; PRODUCT_BUNDLE_IDENTIFIER = "com.datadoghq.EventsExporter-tvOS"; PRODUCT_NAME = EventsExporter; SDKROOT = appletvos; diff --git a/Sources/DatadogSDKTesting/DDTestModule.swift b/Sources/DatadogSDKTesting/DDTestModule.swift index 7ff6ab12..a8a36e54 100644 --- a/Sources/DatadogSDKTesting/DDTestModule.swift +++ b/Sources/DatadogSDKTesting/DDTestModule.swift @@ -152,9 +152,11 @@ public class DDTestModule: NSObject, Encodable { metrics[DDTestSuiteVisibilityTags.testCoverageLines] = linesCovered } DDTestMonitor.tracer.eventsExporter?.exportEvent(event: DDTestModuleEnvelope(self)) + Log.debug("Exported module_end event moduleId: \(self.id)") let testSession = DDTestSession(testModule: self) DDTestMonitor.tracer.eventsExporter?.exportEvent(event: DDTestSession.DDTestSessionEnvelope(testSession)) + Log.debug("Exported session_end event sessionId: \(self.sessionId)") if let coverageHelper = DDTestMonitor.instance?.coverageHelper { /// We need to wait for all the traces to be written to the backend before exiting diff --git a/Sources/DatadogSDKTesting/DDTestMonitor.swift b/Sources/DatadogSDKTesting/DDTestMonitor.swift index ca37d1a8..1e4b3b64 100644 --- a/Sources/DatadogSDKTesting/DDTestMonitor.swift +++ b/Sources/DatadogSDKTesting/DDTestMonitor.swift @@ -266,6 +266,13 @@ internal class DDTestMonitor { guard !DDTestMonitor.env.disableTestInstrumenting else { return } + + instrumentationWorkQueue.addOperation { + Log.measure(name: "DDTracer") { + _ = DDTestMonitor.tracer + } + } + if !DDTestMonitor.env.disableCrashHandler { instrumentationWorkQueue.addOperation { diff --git a/Sources/DatadogSDKTesting/DDTestObserver.swift b/Sources/DatadogSDKTesting/DDTestObserver.swift index 68ce472a..c406dc16 100644 --- a/Sources/DatadogSDKTesting/DDTestObserver.swift +++ b/Sources/DatadogSDKTesting/DDTestObserver.swift @@ -25,6 +25,7 @@ class DDTestObserver: NSObject, XCTestObservation { func startObserving() { XCTestObservationCenter.shared.addTestObserver(self) + Log.debug("Start observing DDtestObserver: \(ObjectIdentifier(self))") } func testBundleWillStart(_ testBundle: Bundle) { diff --git a/Sources/DatadogSDKTesting/DDTestSuite.swift b/Sources/DatadogSDKTesting/DDTestSuite.swift index cc2863cc..88050016 100644 --- a/Sources/DatadogSDKTesting/DDTestSuite.swift +++ b/Sources/DatadogSDKTesting/DDTestSuite.swift @@ -71,7 +71,7 @@ public class DDTestSuite: NSObject, Encodable { meta[DDUISettingsTags.uiSettingsSuiteLocalization] = localization meta[DDUISettingsTags.uiSettingsModuleLocalization] = module.localization DDTestMonitor.tracer.eventsExporter?.exportEvent(event: DDTestSuiteEnvelope(self)) - /// We need to wait for all the traces to be written to the backend before exiting + Log.debug("Exported suite_end event suiteId: \(self.id)") } /// Ends the test suite diff --git a/Sources/EventsExporter/EventsExporter.swift b/Sources/EventsExporter/EventsExporter.swift index 13cedfda..5cc9d2fd 100644 --- a/Sources/EventsExporter/EventsExporter.swift +++ b/Sources/EventsExporter/EventsExporter.swift @@ -20,6 +20,7 @@ public class EventsExporter: SpanExporter { logsExporter = try LogsExporter(config: configuration) coverageExporter = try CoverageExporter(config: configuration) itrService = try ITRService(config: configuration) + Log.debug("EventsExporter created: \(spansExporter.runtimeId)") } public func export(spans: [SpanData]) -> SpanExporterResultCode { diff --git a/Sources/EventsExporter/Spans/SpansExporter.swift b/Sources/EventsExporter/Spans/SpansExporter.swift index 47c384c6..6414f22b 100644 --- a/Sources/EventsExporter/Spans/SpansExporter.swift +++ b/Sources/EventsExporter/Spans/SpansExporter.swift @@ -12,6 +12,7 @@ internal class SpansExporter { let configuration: ExporterConfiguration let spansStorage: FeatureStorage let spansUpload: FeatureUpload + let runtimeId = UUID().uuidString init(config: ExporterConfiguration) throws { self.configuration = config @@ -23,7 +24,7 @@ internal class SpansExporter { ) let genericMetadata = """ - "*": { "env": "\(configuration.environment)", "runtime-id": "\(UUID().uuidString)", "language": "swift", "library_version": "\(configuration.libraryVersion)"} + "*": { "env": "\(configuration.environment)", "runtime-id": "\(runtimeId)", "language": "swift", "library_version": "\(configuration.libraryVersion)"} """ let prefix = """