diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 94583c00..a993f42a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,5 +4,5 @@ # https://help.github.com/en/articles/about-code-owners # -* @nachoBonafonte @DataDog/swift +* @ypopovych @DataDog/swift diff --git a/IntegrationTests/UITests/IntegrationTestsUITests.xctestplan b/IntegrationTests/UITests/IntegrationTestsUITests.xctestplan index 810f00d5..ce659871 100644 --- a/IntegrationTests/UITests/IntegrationTestsUITests.xctestplan +++ b/IntegrationTests/UITests/IntegrationTestsUITests.xctestplan @@ -9,7 +9,6 @@ } ], "defaultOptions" : { - "codeCoverage" : false, "environmentVariableEntries" : [ { "key" : "GITHUB_REPOSITORY", diff --git a/Sources/DatadogSDKTesting/Config.swift b/Sources/DatadogSDKTesting/Config.swift index 49f9ac72..797a6ca7 100644 --- a/Sources/DatadogSDKTesting/Config.swift +++ b/Sources/DatadogSDKTesting/Config.swift @@ -14,7 +14,6 @@ final class Config { /// Datatog Configuration values var apiKey: String? = nil - var applicationKey: String? = nil var service: String? = nil var tags: [String: String] = [:] var customConfigurations: [String: String] = [:] @@ -77,7 +76,6 @@ final class Config { isEnabled = env.has(.isEnabled) ? env[.isEnabled] ?? false : nil apiKey = env[.apiKey] ?? env.get(info: "DatadogApiKey") - applicationKey = env[.applicationKey] ?? env[.appKey] ?? env.get(info: "DatadogApplicationKey") environment = env[.environment] let tracerUnderTesting = env.has(env: .testOutputFile) diff --git a/Sources/DatadogSDKTesting/DDTestMonitor.swift b/Sources/DatadogSDKTesting/DDTestMonitor.swift index 317de632..fcd24be2 100644 --- a/Sources/DatadogSDKTesting/DDTestMonitor.swift +++ b/Sources/DatadogSDKTesting/DDTestMonitor.swift @@ -281,12 +281,6 @@ internal class DDTestMonitor { // Activate Intelligent Test Runner if itrBackendConfig?.testsSkipping ?? false { Log.debug("ITR Enabled") - - if DDTestMonitor.config.applicationKey == nil { - Log.print("APPLICATION_KEY env variable is not set, this is needed for Intelligent Test Runner") - itr = nil - return - } itr = IntelligentTestRunner(configurations: DDTestMonitor.baseConfigurationTags) itr?.start() diff --git a/Sources/DatadogSDKTesting/DDTracer.swift b/Sources/DatadogSDKTesting/DDTracer.swift index a840f5f4..60ed5924 100644 --- a/Sources/DatadogSDKTesting/DDTracer.swift +++ b/Sources/DatadogSDKTesting/DDTracer.swift @@ -96,7 +96,6 @@ internal class DDTracer { environment: env.environment, hostname: hostnameToReport, apiKey: conf.apiKey ?? "", - applicationKey: conf.applicationKey ?? "", endpoint: endpoint, payloadCompression: payloadCompression, performancePreset: .instantDataDelivery, diff --git a/Sources/DatadogSDKTesting/Environment/EnvironmentKeys.swift b/Sources/DatadogSDKTesting/Environment/EnvironmentKeys.swift index 69727801..7d819379 100644 --- a/Sources/DatadogSDKTesting/Environment/EnvironmentKeys.swift +++ b/Sources/DatadogSDKTesting/Environment/EnvironmentKeys.swift @@ -41,8 +41,6 @@ internal enum EnvironmentKey: String, CaseIterable { case ciVisibilityExcludedBranches = "DD_CIVISIBILITY_EXCLUDED_BRANCHES" case ciVisibilityReportHostname = "DD_CIVISIBILITY_REPORT_HOSTNAME" case disableSourceLocation = "DD_DISABLE_SOURCE_LOCATION" - case applicationKey = "DD_APPLICATION_KEY" - case appKey = "DD_APP_KEY" case localTestEnvironmentPort = "DD_LOCAL_TEST_ENVIRONMENT_PORT" case disableGitInformation = "DD_DISABLE_GIT_INFORMATION" case testOutputFile = "TEST_OUTPUT_FILE" diff --git a/Sources/DatadogSDKTesting/Utils/Clock.swift b/Sources/DatadogSDKTesting/Utils/Clock.swift index 9e1b03df..e6888580 100644 --- a/Sources/DatadogSDKTesting/Utils/Clock.swift +++ b/Sources/DatadogSDKTesting/Utils/Clock.swift @@ -77,7 +77,7 @@ final class NTPClock: Clock { self._state = .synced({ Kronos.Clock.now! }) } else { self._state = .synced({ Date() }) - Log.debug("NTP server sync failed") + Log.print("NTP server sync failed") } waiter.signal() } diff --git a/Sources/EventsExporter/CoverageExporter/CoverageExporter.swift b/Sources/EventsExporter/CoverageExporter/CoverageExporter.swift index f197677b..341c2582 100644 --- a/Sources/EventsExporter/CoverageExporter/CoverageExporter.swift +++ b/Sources/EventsExporter/CoverageExporter/CoverageExporter.swift @@ -62,7 +62,7 @@ internal class CoverageExporter { do { profData = try DDCoverageConversor.generateProfData(profrawFile: coverage) } catch { - Log.debug("Prof Data genetation failed: \(error)") + Log.print("Profiler Data genetation failed: \(error)") return } diff --git a/Sources/EventsExporter/ExporterConfiguration.swift b/Sources/EventsExporter/ExporterConfiguration.swift index 5c1c4e66..9b9925e8 100644 --- a/Sources/EventsExporter/ExporterConfiguration.swift +++ b/Sources/EventsExporter/ExporterConfiguration.swift @@ -21,7 +21,6 @@ public struct ExporterConfiguration { /// API key for authentication var apiKey: String - var applicationKey: String /// Endpoint that will be used for reporting. var endpoint: Endpoint @@ -37,7 +36,7 @@ public struct ExporterConfiguration { var logger: Logger - public init(serviceName: String, libraryVersion: String, applicationName: String, applicationVersion: String, environment: String, hostname: String?, apiKey: String, applicationKey: String, endpoint: Endpoint, payloadCompression: Bool = true, source: String = "ios", performancePreset: PerformancePreset = .default, exporterId: String, logger: Logger) { + public init(serviceName: String, libraryVersion: String, applicationName: String, applicationVersion: String, environment: String, hostname: String?, apiKey: String, endpoint: Endpoint, payloadCompression: Bool = true, source: String = "ios", performancePreset: PerformancePreset = .default, exporterId: String, logger: Logger) { self.serviceName = serviceName self.libraryVersion = libraryVersion self.applicationName = applicationName @@ -45,7 +44,6 @@ public struct ExporterConfiguration { self.environment = environment self.hostname = hostname self.apiKey = apiKey - self.applicationKey = applicationKey self.endpoint = endpoint self.payloadCompression = payloadCompression self.source = source diff --git a/Sources/EventsExporter/IntelligentTestRunner/ITRService.swift b/Sources/EventsExporter/IntelligentTestRunner/ITRService.swift index 1541dcab..948190a3 100644 --- a/Sources/EventsExporter/IntelligentTestRunner/ITRService.swift +++ b/Sources/EventsExporter/IntelligentTestRunner/ITRService.swift @@ -29,7 +29,6 @@ internal class ITRService { device: Device.current ), .apiKeyHeader(apiKey: config.apiKey), - .applicationKeyHeader(applicationKey: config.applicationKey), .traceIDHeader(traceID: config.exporterId), .parentSpanIDHeader(parentSpanID: config.exporterId), .samplingPriorityHeader() @@ -46,7 +45,6 @@ internal class ITRService { device: Device.current ), .apiKeyHeader(apiKey: config.apiKey), - .applicationKeyHeader(applicationKey: config.applicationKey), .traceIDHeader(traceID: config.exporterId), .parentSpanIDHeader(parentSpanID: config.exporterId), .samplingPriorityHeader() @@ -63,7 +61,6 @@ internal class ITRService { device: Device.current ), .apiKeyHeader(apiKey: config.apiKey), - .applicationKeyHeader(applicationKey: config.applicationKey), .traceIDHeader(traceID: config.exporterId), .parentSpanIDHeader(parentSpanID: config.exporterId), .samplingPriorityHeader() @@ -80,7 +77,6 @@ internal class ITRService { device: Device.current ), .apiKeyHeader(apiKey: config.apiKey), - .applicationKeyHeader(applicationKey: config.applicationKey), .traceIDHeader(traceID: config.exporterId), .parentSpanIDHeader(parentSpanID: config.exporterId), .samplingPriorityHeader() diff --git a/Sources/EventsExporter/Upload/HTTPHeader.swift b/Sources/EventsExporter/Upload/HTTPHeader.swift index cc8bf438..cb172257 100644 --- a/Sources/EventsExporter/Upload/HTTPHeader.swift +++ b/Sources/EventsExporter/Upload/HTTPHeader.swift @@ -65,11 +65,6 @@ struct HTTPHeader { return HTTPHeader(field: aPIKeyHeaderField, value: .constant(apiKey)) } - /// Datadog request Application Key authentication header. - static func applicationKeyHeader(applicationKey: String) -> HTTPHeader { - return HTTPHeader(field: applicationKeyHeaderField, value: .constant(applicationKey)) - } - /// Datadog request Application Key authentication header. static func hostnameHeader(hostname: String) -> HTTPHeader { return HTTPHeader(field: hostnameHeaderField, value: .constant(hostname)) diff --git a/Tests/EventsExporter/EventsExporterTests.swift b/Tests/EventsExporter/EventsExporterTests.swift index 0abe3b97..8708618e 100644 --- a/Tests/EventsExporter/EventsExporterTests.swift +++ b/Tests/EventsExporter/EventsExporterTests.swift @@ -53,7 +53,6 @@ class EventsExporterTests: XCTestCase { environment: "environment", hostname: "hostname", apiKey: "apikey", - applicationKey: "applicationkey", endpoint: Endpoint.custom( testsURL: URL(string: "http://localhost:33333/traces")!, logsURL: URL(string: "http://localhost:33333/logs")! diff --git a/Tests/EventsExporter/Logs/LogsExporterTests.swift b/Tests/EventsExporter/Logs/LogsExporterTests.swift index 4ca3cb69..a9b2d644 100644 --- a/Tests/EventsExporter/Logs/LogsExporterTests.swift +++ b/Tests/EventsExporter/Logs/LogsExporterTests.swift @@ -43,7 +43,6 @@ class LogsExporterTests: XCTestCase { environment: "environment", hostname: "hostname", apiKey: "apikey", - applicationKey: "applicationkey", endpoint: Endpoint.custom( testsURL: URL(string: "http://localhost:33333/traces")!, logsURL: URL(string: "http://localhost:33333/logs")! diff --git a/Tests/EventsExporter/Spans/SpansExporterTests.swift b/Tests/EventsExporter/Spans/SpansExporterTests.swift index ad26c68c..e743bb35 100644 --- a/Tests/EventsExporter/Spans/SpansExporterTests.swift +++ b/Tests/EventsExporter/Spans/SpansExporterTests.swift @@ -44,7 +44,6 @@ class SpansExporterTests: XCTestCase { environment: "environment", hostname: nil, apiKey: "apikey", - applicationKey: "applicationkey", endpoint: Endpoint.custom( testsURL: URL(string: "http://localhost:33333/traces")!, logsURL: URL(string: "http://localhost:33333/logs")!