diff --git a/Sources/BalancingBucketQueue/Models/JobQueue.swift b/Sources/BalancingBucketQueue/Models/JobQueue.swift index 9a4c3fa8f..d363c5c30 100644 --- a/Sources/BalancingBucketQueue/Models/JobQueue.swift +++ b/Sources/BalancingBucketQueue/Models/JobQueue.swift @@ -9,22 +9,19 @@ public struct JobQueue: DefinesExecutionOrder { public let job: Job public let jobGroup: JobGroup public let resultsCollector: ResultsCollector - public let persistentMetricsJobId: String public init( analyticsConfiguration: AnalyticsConfiguration, bucketQueue: BucketQueue, job: Job, jobGroup: JobGroup, - resultsCollector: ResultsCollector, - persistentMetricsJobId: String + resultsCollector: ResultsCollector ) { self.analyticsConfiguration = analyticsConfiguration self.bucketQueue = bucketQueue self.job = job self.jobGroup = jobGroup self.resultsCollector = resultsCollector - self.persistentMetricsJobId = persistentMetricsJobId } public func executionOrder(relativeTo other: JobQueue) -> ExecutionOrder { diff --git a/Sources/BalancingBucketQueue/New/MultipleQueuesEnqueueableBucketReceptor.swift b/Sources/BalancingBucketQueue/New/MultipleQueuesEnqueueableBucketReceptor.swift index 0146feaea..41756e755 100644 --- a/Sources/BalancingBucketQueue/New/MultipleQueuesEnqueueableBucketReceptor.swift +++ b/Sources/BalancingBucketQueue/New/MultipleQueuesEnqueueableBucketReceptor.swift @@ -38,8 +38,7 @@ public final class MultipleQueuesEnqueueableBucketReceptor: EnqueueableBucketRec jobGroupId: prioritizedJob.jobGroupId, jobGroupPriority: prioritizedJob.jobGroupPriority ), - resultsCollector: ResultsCollector(), - persistentMetricsJobId: prioritizedJob.persistentMetricsJobId + resultsCollector: ResultsCollector() ) ) multipleQueuesContainer.removeFromDeleted(jobId: prioritizedJob.jobId) diff --git a/Sources/BalancingBucketQueue/New/MultipleQueuesJobManipulator.swift b/Sources/BalancingBucketQueue/New/MultipleQueuesJobManipulator.swift index 7b316e8f9..a6cfa418f 100644 --- a/Sources/BalancingBucketQueue/New/MultipleQueuesJobManipulator.swift +++ b/Sources/BalancingBucketQueue/New/MultipleQueuesJobManipulator.swift @@ -39,16 +39,18 @@ public final class MultipleQueuesJobManipulator: JobManipulator { for deletedJobQueue in jobQueuesToDelete { multipleQueuesContainer.untrack(jobGroup: deletedJobQueue.jobGroup) - try specificMetricRecorderProvider.specificMetricRecorder( - analyticsConfiguration: deletedJobQueue.analyticsConfiguration - ).capture( - JobProcessingDurationMetric( - queueHost: LocalHostDeterminer.currentHostAddress, - version: emceeVersion, - persistentMetricsJobId: deletedJobQueue.persistentMetricsJobId, - duration: dateProvider.currentDate().timeIntervalSince(deletedJobQueue.job.creationTime) + if let persistentMetricsJobId = deletedJobQueue.analyticsConfiguration.persistentMetricsJobId { + try specificMetricRecorderProvider.specificMetricRecorder( + analyticsConfiguration: deletedJobQueue.analyticsConfiguration + ).capture( + JobProcessingDurationMetric( + queueHost: LocalHostDeterminer.currentHostAddress, + version: emceeVersion, + persistentMetricsJobId: persistentMetricsJobId, + duration: dateProvider.currentDate().timeIntervalSince(deletedJobQueue.job.creationTime) + ) ) - ) + } } } } diff --git a/Sources/DistWorker/DistWorker.swift b/Sources/DistWorker/DistWorker.swift index 52eb02aa4..10398b849 100644 --- a/Sources/DistWorker/DistWorker.swift +++ b/Sources/DistWorker/DistWorker.swift @@ -50,12 +50,11 @@ public final class DistWorker: SchedulerDataSource, SchedulerDelegate { public init( di: DI, - logger: ContextualLogger, version: Version, workerId: WorkerId - ) { + ) throws { self.di = di - self.logger = logger.forType(Self.self) + self.logger = try di.get(ContextualLogger.self).forType(Self.self) self.httpRestServer = HTTPRESTServer( automaticTerminationController: StayAliveTerminationController(), logger: logger, diff --git a/Sources/EmceeLib/Commands/DistWorkCommand.swift b/Sources/EmceeLib/Commands/DistWorkCommand.swift index 1a57bee09..296428620 100644 --- a/Sources/EmceeLib/Commands/DistWorkCommand.swift +++ b/Sources/EmceeLib/Commands/DistWorkCommand.swift @@ -105,11 +105,13 @@ public final class DistWorkCommand: Command { for: WorkerCapabilitiesProvider.self ) - return DistWorker( + let updatedLogger = try di.get(ContextualLogger.self) + .withMetadata(key: .workerId, value: workerId.value) + .withMetadata(key: .emceeVersion, value: version.value) + di.set(updatedLogger) + + return try DistWorker( di: di, - logger: try di.get(ContextualLogger.self) - .withMetadata(key: .workerId, value: workerId.value) - .withMetadata(key: .emceeVersion, value: version.value), version: version, workerId: workerId ) diff --git a/Sources/EmceeLib/Utils/DetailedActivityLoggableProcessControllerProvider.swift b/Sources/EmceeLib/Utils/DetailedActivityLoggableProcessControllerProvider.swift index f7904f9b1..25a52675a 100644 --- a/Sources/EmceeLib/Utils/DetailedActivityLoggableProcessControllerProvider.swift +++ b/Sources/EmceeLib/Utils/DetailedActivityLoggableProcessControllerProvider.swift @@ -7,15 +7,18 @@ import ProcessController public final class DetailedActivityLoggableProcessControllerProvider: ProcessControllerProvider { private let processControllerProvider: LoggableProcessControllerProvider - private let logger: ContextualLogger + + private let di: DI public init( di: DI ) throws { - logger = try di.get(ContextualLogger.self).forType(Self.self) + self.di = di processControllerProvider = LoggableProcessControllerProvider( - pathProvider: { [logger] processName -> (stdout: AbsolutePath, stderr: AbsolutePath) in + pathProvider: { [di] processName -> (stdout: AbsolutePath, stderr: AbsolutePath) in + let logger = try di.get(ContextualLogger.self).forType(Self.self) + let paths = try di.get(LoggingSetup.self).childProcessLogsContainerProvider().paths(subprocessName: processName) logger.debug( "Subprocess output will be stored: stdout: \(paths.stdout) stderr: \(paths.stderr)", @@ -31,6 +34,7 @@ public final class DetailedActivityLoggableProcessControllerProvider: ProcessCon } public func createProcessController(subprocess: Subprocess) throws -> ProcessController { + let logger = try di.get(ContextualLogger.self).forType(Self.self) let processController = try processControllerProvider.createProcessController(subprocess: subprocess) processController.onStart { [logger] sender, _ in diff --git a/Sources/EmceeLib/Utils/JobPreparer/JobPreparer.swift b/Sources/EmceeLib/Utils/JobPreparer/JobPreparer.swift index a3650c2ad..4e590c70f 100644 --- a/Sources/EmceeLib/Utils/JobPreparer/JobPreparer.swift +++ b/Sources/EmceeLib/Utils/JobPreparer/JobPreparer.swift @@ -40,7 +40,6 @@ public final class JobPreparer { duration: duration, emceeVersion: emceeVersion, analyticsConfiguration: testArgFile.prioritizedJob.analyticsConfiguration, - persistentMetricsJobId: testArgFile.prioritizedJob.persistentMetricsJobId, queueHost: queueServerAddress.host, successful: error == nil ) @@ -57,14 +56,13 @@ public final class JobPreparer { remoteCache: try di.get(RuntimeDumpRemoteCacheProvider.self).remoteCache(config: remoteCacheConfig), testArgFileEntries: testArgFile.entries, testDiscoveryQuerier: try di.get(), - analyticsConfiguration: testArgFile.prioritizedJob.analyticsConfiguration, - persistentMetricsJobId: testArgFile.prioritizedJob.persistentMetricsJobId + analyticsConfiguration: testArgFile.prioritizedJob.analyticsConfiguration ) let logger = try di.get(ContextualLogger.self) .forType(Self.self) - .withMetadata(key: .persistentMetricsJobId, value: testArgFile.prioritizedJob.persistentMetricsJobId) - + .withMetadata(key: .persistentMetricsJobId, value: testArgFile.prioritizedJob.analyticsConfiguration.persistentMetricsJobId) + _ = try testEntriesValidator.validatedTestEntries { testArgFileEntry, validatedTestEntry in let testEntryConfigurationGenerator = TestEntryConfigurationGenerator( analyticsConfiguration: testArgFile.prioritizedJob.analyticsConfiguration, @@ -96,20 +94,21 @@ public final class JobPreparer { duration: TimeInterval, emceeVersion: Version, analyticsConfiguration: AnalyticsConfiguration, - persistentMetricsJobId: String, queueHost: String, successful: Bool ) throws { - try di.get(SpecificMetricRecorderProvider.self).specificMetricRecorder( - analyticsConfiguration: analyticsConfiguration - ).capture( - JobPreparationDurationMetric( - queueHost: queueHost, - version: emceeVersion, - persistentMetricsJobId: persistentMetricsJobId, - successful: successful, - duration: duration + if let persistentMetricsJobId = analyticsConfiguration.persistentMetricsJobId { + try di.get(SpecificMetricRecorderProvider.self).specificMetricRecorder( + analyticsConfiguration: analyticsConfiguration + ).capture( + JobPreparationDurationMetric( + queueHost: queueHost, + version: emceeVersion, + persistentMetricsJobId: persistentMetricsJobId, + successful: successful, + duration: duration + ) ) - ) + } } } diff --git a/Sources/EmceeLib/Utils/PipelinedTestDiscoverer.swift b/Sources/EmceeLib/Utils/PipelinedTestDiscoverer.swift index 7bb126348..4259b4b79 100644 --- a/Sources/EmceeLib/Utils/PipelinedTestDiscoverer.swift +++ b/Sources/EmceeLib/Utils/PipelinedTestDiscoverer.swift @@ -45,7 +45,7 @@ public final class PipelinedTestDiscoverer { remoteCacheConfig: RuntimeDumpRemoteCacheConfig? ) throws -> [[DiscoveredTestEntry]] { let logger = self.logger - .withMetadata(key: .persistentMetricsJobId, value: testArgFile.prioritizedJob.persistentMetricsJobId) + .withMetadata(key: .persistentMetricsJobId, value: testArgFile.prioritizedJob.analyticsConfiguration.persistentMetricsJobId) let discoveredTests = AtomicValue<[[DiscoveredTestEntry]]>( Array(repeating: [], count: testArgFile.entries.count) @@ -90,7 +90,6 @@ public final class PipelinedTestDiscoverer { testTimeoutConfiguration: testTimeoutConfigurationForRuntimeDump, testsToValidate: testArgFileEntry.testsToRun, xcTestBundleLocation: testArgFileEntry.buildArtifacts.xcTestBundle.location, - persistentMetricsJobId: testArgFile.prioritizedJob.persistentMetricsJobId, remoteCache: runtimeDumpRemoteCacheProvider.remoteCache(config: remoteCacheConfig) ) diff --git a/Sources/EmceeLib/Utils/TestEntriesValidator/TestEntriesValidator.swift b/Sources/EmceeLib/Utils/TestEntriesValidator/TestEntriesValidator.swift index 653ef1124..39b8aa897 100644 --- a/Sources/EmceeLib/Utils/TestEntriesValidator/TestEntriesValidator.swift +++ b/Sources/EmceeLib/Utils/TestEntriesValidator/TestEntriesValidator.swift @@ -13,21 +13,18 @@ public final class TestEntriesValidator { private let testArgFileEntries: [TestArgFileEntry] private let testDiscoveryQuerier: TestDiscoveryQuerier private let analyticsConfiguration: AnalyticsConfiguration - private let persistentMetricsJobId: String private let transformer = TestToRunIntoTestEntryTransformer() public init( remoteCache: RuntimeDumpRemoteCache, testArgFileEntries: [TestArgFileEntry], testDiscoveryQuerier: TestDiscoveryQuerier, - analyticsConfiguration: AnalyticsConfiguration, - persistentMetricsJobId: String + analyticsConfiguration: AnalyticsConfiguration ) { self.remoteCache = remoteCache self.testArgFileEntries = testArgFileEntries self.testDiscoveryQuerier = testDiscoveryQuerier self.analyticsConfiguration = analyticsConfiguration - self.persistentMetricsJobId = persistentMetricsJobId } public func validatedTestEntries( @@ -65,7 +62,6 @@ public final class TestEntriesValidator { testTimeoutConfiguration: testTimeoutConfigurationForRuntimeDump, testsToValidate: testArgFileEntry.testsToRun, xcTestBundleLocation: testArgFileEntry.buildArtifacts.xcTestBundle.location, - persistentMetricsJobId: persistentMetricsJobId, remoteCache: remoteCache ) diff --git a/Sources/EmceeLogging/ContextualLogger.swift b/Sources/EmceeLogging/ContextualLogger.swift index 2ae64490d..46b2c1cea 100644 --- a/Sources/EmceeLogging/ContextualLogger.swift +++ b/Sources/EmceeLogging/ContextualLogger.swift @@ -141,4 +141,15 @@ public extension ContextualLogger { addedMetadata.merge(keyValues) { _, new -> String in new } return ContextualLogger(logger: logger, addedMetadata: addedMetadata) } + + func withMetadata(key: ContextKeys, value: String?) -> ContextualLogger { + withMetadata(key: key.rawValue, value: value) + } + + func withMetadata(key: String, value: String?) -> ContextualLogger { + if let value = value { + return withMetadata(key: key, value: value) + } + return self + } } diff --git a/Sources/EmceeLogging/KibanaHandler.swift b/Sources/EmceeLogging/KibanaHandler.swift index c8f4c3e24..8f181339d 100644 --- a/Sources/EmceeLogging/KibanaHandler.swift +++ b/Sources/EmceeLogging/KibanaHandler.swift @@ -1,3 +1,4 @@ +import Extensions import Foundation import Kibana import Logging @@ -29,7 +30,7 @@ public final class KibanaLoggerHandler: LoggerHandler { line: UInt ) { var kibanaPayload = [ - "fileLine": "\(file):\(line)", + "fileLine": "\(file.lastPathComponent):\(line)", ] for keyValue in metadata ?? [:] { diff --git a/Sources/QueueModels/PrioritizedJob.swift b/Sources/QueueModels/PrioritizedJob.swift index c6065d1c0..be3a807a6 100644 --- a/Sources/QueueModels/PrioritizedJob.swift +++ b/Sources/QueueModels/PrioritizedJob.swift @@ -7,25 +7,22 @@ public struct PrioritizedJob: Hashable, Codable, CustomStringConvertible { public let jobGroupPriority: Priority public let jobId: JobId public let jobPriority: Priority - public let persistentMetricsJobId: String public init( analyticsConfiguration: AnalyticsConfiguration, jobGroupId: JobGroupId, jobGroupPriority: Priority, jobId: JobId, - jobPriority: Priority, - persistentMetricsJobId: String + jobPriority: Priority ) { self.analyticsConfiguration = analyticsConfiguration self.jobGroupId = jobGroupId self.jobGroupPriority = jobGroupPriority self.jobId = jobId self.jobPriority = jobPriority - self.persistentMetricsJobId = persistentMetricsJobId } public var description: String { - return "<\(type(of: self)) \(jobGroupId) \(jobGroupPriority) \(jobId) \(jobPriority) \(persistentMetricsJobId)>" + return "<\(type(of: self)) \(jobGroupId) \(jobGroupPriority) \(jobId) \(jobPriority) \(analyticsConfiguration)>" } } diff --git a/Sources/TestArgFile/TestArgFile.swift b/Sources/TestArgFile/TestArgFile.swift index c33033f4e..9496e4ba2 100644 --- a/Sources/TestArgFile/TestArgFile.swift +++ b/Sources/TestArgFile/TestArgFile.swift @@ -47,15 +47,12 @@ public struct TestArgFile: Codable, Equatable { jobPriority let analyticsConfiguration = try container.decodeIfPresent(AnalyticsConfiguration.self, forKey: .analyticsConfiguration) ?? TestArgFileDefaultValues.analyticsConfiguration - let persistentMetricsJobId = try container.decodeIfPresent(String.self, forKey: .persistentMetricsJobId) ?? - TestArgFileDefaultValues.persistentMetricsJobId return PrioritizedJob( analyticsConfiguration: analyticsConfiguration, jobGroupId: jobGroupId, jobGroupPriority: jobGroupPriority, jobId: jobId, - jobPriority: jobPriority, - persistentMetricsJobId: persistentMetricsJobId + jobPriority: jobPriority ) }() diff --git a/Sources/TestArgFile/TestArgFileDefaultValues.swift b/Sources/TestArgFile/TestArgFileDefaultValues.swift index 524e6a2f5..c2d31016c 100644 --- a/Sources/TestArgFile/TestArgFileDefaultValues.swift +++ b/Sources/TestArgFile/TestArgFileDefaultValues.swift @@ -48,6 +48,5 @@ public enum TestArgFileDefaultValues { testRunnerMaximumSilenceDuration: 60 ) public static let workerCapabilityRequirements: Set = [] - public static let persistentMetricsJobId: String = "UnidentifiedJob" public static let analyticsConfiguration = AnalyticsConfiguration() } diff --git a/Sources/TestDiscovery/Models/TestDiscoveryConfiguration.swift b/Sources/TestDiscovery/Models/TestDiscoveryConfiguration.swift index b7a05a440..49486ebec 100644 --- a/Sources/TestDiscovery/Models/TestDiscoveryConfiguration.swift +++ b/Sources/TestDiscovery/Models/TestDiscoveryConfiguration.swift @@ -20,7 +20,6 @@ public struct TestDiscoveryConfiguration { public let testTimeoutConfiguration: TestTimeoutConfiguration public let testsToValidate: [TestToRun] public let xcTestBundleLocation: TestBundleLocation - public let persistentMetricsJobId: String public let remoteCache: RuntimeDumpRemoteCache public init( @@ -36,7 +35,6 @@ public struct TestDiscoveryConfiguration { testTimeoutConfiguration: TestTimeoutConfiguration, testsToValidate: [TestToRun], xcTestBundleLocation: TestBundleLocation, - persistentMetricsJobId: String, remoteCache: RuntimeDumpRemoteCache ) { self.analyticsConfiguration = analyticsConfiguration @@ -51,7 +49,6 @@ public struct TestDiscoveryConfiguration { self.testTimeoutConfiguration = testTimeoutConfiguration self.testsToValidate = testsToValidate self.xcTestBundleLocation = xcTestBundleLocation - self.persistentMetricsJobId = persistentMetricsJobId self.remoteCache = remoteCache } } diff --git a/Sources/TestDiscovery/SpecificTestDiscoverers/RuntimeDumpTestDiscoverer.swift b/Sources/TestDiscovery/SpecificTestDiscoverers/RuntimeDumpTestDiscoverer.swift index 177134a95..7acaab454 100644 --- a/Sources/TestDiscovery/SpecificTestDiscoverers/RuntimeDumpTestDiscoverer.swift +++ b/Sources/TestDiscovery/SpecificTestDiscoverers/RuntimeDumpTestDiscoverer.swift @@ -99,7 +99,7 @@ final class RuntimeDumpTestDiscoverer: SpecificTestDiscoverer { developerDirLocator: developerDirLocator, fileSystem: fileSystem, logger: logger, - persistentMetricsJobId: configuration.persistentMetricsJobId, + persistentMetricsJobId: configuration.analyticsConfiguration.persistentMetricsJobId, pluginEventBusProvider: pluginEventBusProvider, resourceLocationResolver: resourceLocationResolver, specificMetricRecorder: specificMetricRecorder, diff --git a/Sources/TestDiscovery/TestDiscoveryQuerierImpl.swift b/Sources/TestDiscovery/TestDiscoveryQuerierImpl.swift index f805f0125..30efb41b2 100644 --- a/Sources/TestDiscovery/TestDiscoveryQuerierImpl.swift +++ b/Sources/TestDiscovery/TestDiscoveryQuerierImpl.swift @@ -133,7 +133,7 @@ public final class TestDiscoveryQuerierImpl: TestDiscoveryQuerier { }, result: { error, duration in reportDiscoveryDuration( - persistentMetricsJobId: configuration.persistentMetricsJobId, + persistentMetricsJobId: configuration.analyticsConfiguration.persistentMetricsJobId, duration: duration, isSuccessful: error == nil, specificMetricRecorder: specificMetricRecorder @@ -197,20 +197,22 @@ public final class TestDiscoveryQuerierImpl: TestDiscoveryQuerier { } private func reportDiscoveryDuration( - persistentMetricsJobId: String, + persistentMetricsJobId: String?, duration: TimeInterval, isSuccessful: Bool, specificMetricRecorder: SpecificMetricRecorder ) { - specificMetricRecorder.capture( - TestDiscoveryDurationMetric( - host: LocalHostDeterminer.currentHostAddress, - version: version, - persistentMetricsJobId: persistentMetricsJobId, - isSuccessful: isSuccessful, - duration: duration + if let persistentMetricsJobId = persistentMetricsJobId { + specificMetricRecorder.capture( + TestDiscoveryDurationMetric( + host: LocalHostDeterminer.currentHostAddress, + version: version, + persistentMetricsJobId: persistentMetricsJobId, + isSuccessful: isSuccessful, + duration: duration + ) ) - ) + } } private func createSpecificTestDiscoverer( diff --git a/Tests/BalancingBucketQueueTests/BalancingBucketQueueIntegrationTests.swift b/Tests/BalancingBucketQueueTests/BalancingBucketQueueIntegrationTests.swift index 06612c3da..57148342a 100644 --- a/Tests/BalancingBucketQueueTests/BalancingBucketQueueIntegrationTests.swift +++ b/Tests/BalancingBucketQueueTests/BalancingBucketQueueIntegrationTests.swift @@ -246,8 +246,7 @@ final class BalancingBucketQueueIntegrationTests: XCTestCase { jobGroupId: "group1", jobGroupPriority: .medium, jobId: "job1", - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) ) let bucket2 = BucketFixtures.createBucket(testEntries: [TestEntryFixtures.testEntry(className: "class2")]) @@ -258,8 +257,7 @@ final class BalancingBucketQueueIntegrationTests: XCTestCase { jobGroupId: "group2", jobGroupPriority: .highest, jobId: "job2", - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) ) @@ -460,8 +458,7 @@ final class BalancingBucketQueueIntegrationTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: anotherJobId, - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) lazy var balancingQueue = BalancingBucketQueueImpl( bucketQueueFactory: bucketQueueFactory, @@ -485,8 +482,7 @@ final class BalancingBucketQueueIntegrationTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: highlyPrioritizedJobId, - jobPriority: .highest, - persistentMetricsJobId: "" + jobPriority: .highest ) lazy var highlyPrioritizedJobId: JobId = "highPriorityJobId" lazy var jobId: JobId = "jobId" @@ -495,8 +491,7 @@ final class BalancingBucketQueueIntegrationTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: jobId, - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) lazy var uniqueIdentifierGenerator = FixedValueUniqueIdentifierGenerator() lazy var workerAlivenessProvider = WorkerAlivenessProviderImpl( diff --git a/Tests/BalancingBucketQueueTests/Models+Helpers.swift b/Tests/BalancingBucketQueueTests/Models+Helpers.swift index 3e907cad2..9792cd4f6 100644 --- a/Tests/BalancingBucketQueueTests/Models+Helpers.swift +++ b/Tests/BalancingBucketQueueTests/Models+Helpers.swift @@ -40,7 +40,6 @@ func createJobQueue( bucketQueue: bucketQueue, job: job, jobGroup: jobGroup, - resultsCollector: resultsCollector, - persistentMetricsJobId: "" + resultsCollector: resultsCollector ) } diff --git a/Tests/BalancingBucketQueueTests/MultipleQueuesEnqueueableBucketReceptorTests.swift b/Tests/BalancingBucketQueueTests/MultipleQueuesEnqueueableBucketReceptorTests.swift index 36de1f388..886326398 100644 --- a/Tests/BalancingBucketQueueTests/MultipleQueuesEnqueueableBucketReceptorTests.swift +++ b/Tests/BalancingBucketQueueTests/MultipleQueuesEnqueueableBucketReceptorTests.swift @@ -15,8 +15,7 @@ final class MultipleQueuesEnqueueableBucketReceptorTests: XCTestCase { jobGroupId: "group", jobGroupPriority: .medium, jobId: "job", - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) lazy var receptor = MultipleQueuesEnqueueableBucketReceptor( bucketQueueFactory: bucketQueueFactory, diff --git a/Tests/BalancingBucketQueueTests/MultipleQueuesRunningQueueStateProviderTests.swift b/Tests/BalancingBucketQueueTests/MultipleQueuesRunningQueueStateProviderTests.swift index a7c3e5623..3be08073e 100644 --- a/Tests/BalancingBucketQueueTests/MultipleQueuesRunningQueueStateProviderTests.swift +++ b/Tests/BalancingBucketQueueTests/MultipleQueuesRunningQueueStateProviderTests.swift @@ -101,8 +101,7 @@ final class MultipleQueuesRunningQueueStateProviderTests: XCTestCase { bucketQueue: bucketQueue, job: Job(creationTime: Date(), jobId: jobId, priority: .medium), jobGroup: JobGroup(creationTime: Date(), jobGroupId: JobGroupId("group_" + jobId.value), priority: .medium), - resultsCollector: ResultsCollector(), - persistentMetricsJobId: "" + resultsCollector: ResultsCollector() ) } } diff --git a/Tests/EmceeLibTests/PipelinedTestDiscovererTests.swift b/Tests/EmceeLibTests/PipelinedTestDiscovererTests.swift index a2e8ce057..d82b09afa 100644 --- a/Tests/EmceeLibTests/PipelinedTestDiscovererTests.swift +++ b/Tests/EmceeLibTests/PipelinedTestDiscovererTests.swift @@ -208,8 +208,7 @@ extension TestArgFile { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: "jobId", - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ), testDestinationConfigurations: [] ) diff --git a/Tests/EmceeLibTests/TestEntriesValidatorTests.swift b/Tests/EmceeLibTests/TestEntriesValidatorTests.swift index 17fdce02e..0042ae593 100644 --- a/Tests/EmceeLibTests/TestEntriesValidatorTests.swift +++ b/Tests/EmceeLibTests/TestEntriesValidatorTests.swift @@ -96,8 +96,7 @@ final class TestEntriesValidatorTests: XCTestCase { remoteCache: NoOpRuntimeDumpRemoteCache(), testArgFileEntries: testArgFileEntries, testDiscoveryQuerier: testDiscoveryQuerier, - analyticsConfiguration: AnalyticsConfiguration(), - persistentMetricsJobId: "" + analyticsConfiguration: AnalyticsConfiguration() ) } diff --git a/Tests/QueueClientTests/TestSchedulerTests.swift b/Tests/QueueClientTests/TestSchedulerTests.swift index a4cc92268..a2cbd6be7 100644 --- a/Tests/QueueClientTests/TestSchedulerTests.swift +++ b/Tests/QueueClientTests/TestSchedulerTests.swift @@ -22,8 +22,7 @@ final class TestSchedulerTests: XCTestCase { jobGroupId: "group", jobGroupPriority: .lowest, jobId: "job", - jobPriority: .highest, - persistentMetricsJobId: "" + jobPriority: .highest ) func test___success_scenario() { diff --git a/Tests/QueueServerTests/EndpointTests/ScheduleTestsEndpointTests.swift b/Tests/QueueServerTests/EndpointTests/ScheduleTestsEndpointTests.swift index c1dcba29f..1e5a2ea16 100644 --- a/Tests/QueueServerTests/EndpointTests/ScheduleTestsEndpointTests.swift +++ b/Tests/QueueServerTests/EndpointTests/ScheduleTestsEndpointTests.swift @@ -171,8 +171,7 @@ final class ScheduleTestsEndpointTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: jobId, - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) let testEntryConfigurations = TestEntryConfigurationFixtures() .add(testEntry: TestEntryFixtures.testEntry()) diff --git a/Tests/QueueServerTests/QueueServerTests.swift b/Tests/QueueServerTests/QueueServerTests.swift index c71c47db1..f42b90f9d 100644 --- a/Tests/QueueServerTests/QueueServerTests.swift +++ b/Tests/QueueServerTests/QueueServerTests.swift @@ -34,8 +34,7 @@ final class QueueServerTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: jobId, - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) private let automaticTerminationController = AutomaticTerminationControllerFactory( automaticTerminationPolicy: .stayAlive diff --git a/Tests/QueueServerTests/TestsEnqueuerTests.swift b/Tests/QueueServerTests/TestsEnqueuerTests.swift index 21fef8b09..000172ee2 100644 --- a/Tests/QueueServerTests/TestsEnqueuerTests.swift +++ b/Tests/QueueServerTests/TestsEnqueuerTests.swift @@ -19,8 +19,7 @@ final class TestsEnqueuerTests: XCTestCase { jobGroupId: "groupId", jobGroupPriority: .medium, jobId: "jobId", - jobPriority: .medium, - persistentMetricsJobId: "" + jobPriority: .medium ) func test() throws { diff --git a/Tests/TestArgFileTests/TestArgFileTests.swift b/Tests/TestArgFileTests/TestArgFileTests.swift index b2b6b45b3..17032e27d 100644 --- a/Tests/TestArgFileTests/TestArgFileTests.swift +++ b/Tests/TestArgFileTests/TestArgFileTests.swift @@ -35,6 +35,10 @@ final class TestArgFileTests: XCTestCase { "http://kibana.example.com:9200" ], "indexPattern": "index-pattern" + }, + "persistentMetricsJobId": "persistentMetricsJobId", + "metadata": { + "some": "value" } } } @@ -64,13 +68,14 @@ final class TestArgFileTests: XCTestCase { URL(string: "http://kibana.example.com:9200")! ], indexPattern: "index-pattern" - ) + ), + persistentMetricsJobId: "persistentMetricsJobId", + metadata: ["some": "value"] ), jobGroupId: "jobGroupId", jobGroupPriority: 100, jobId: "jobId", - jobPriority: 500, - persistentMetricsJobId: "persistentMetricsJobId" + jobPriority: 500 ), testDestinationConfigurations: [] ) @@ -100,8 +105,7 @@ final class TestArgFileTests: XCTestCase { jobGroupId: "jobId", jobGroupPriority: TestArgFileDefaultValues.priority, jobId: "jobId", - jobPriority: TestArgFileDefaultValues.priority, - persistentMetricsJobId: TestArgFileDefaultValues.persistentMetricsJobId + jobPriority: TestArgFileDefaultValues.priority ), testDestinationConfigurations: [] ) diff --git a/Tests/TestArgFileTests/TestArgFileValidatorTests.swift b/Tests/TestArgFileTests/TestArgFileValidatorTests.swift index 0ecfb0014..b1d3c48c7 100644 --- a/Tests/TestArgFileTests/TestArgFileValidatorTests.swift +++ b/Tests/TestArgFileTests/TestArgFileValidatorTests.swift @@ -160,8 +160,7 @@ final class TestArgFileValidatorTests: XCTestCase { jobGroupId: "", jobGroupPriority: 0, jobId: "", - jobPriority: 0, - persistentMetricsJobId: "" + jobPriority: 0 ), testDestinationConfigurations: [] ) diff --git a/Tests/TestDiscoveryTests/ExecutableTestDiscovererTests.swift b/Tests/TestDiscoveryTests/ExecutableTestDiscovererTests.swift index 9dd0aeb53..6868afdcc 100644 --- a/Tests/TestDiscoveryTests/ExecutableTestDiscovererTests.swift +++ b/Tests/TestDiscoveryTests/ExecutableTestDiscovererTests.swift @@ -228,7 +228,6 @@ final class ExecutableTestDiscovererTests: XCTestCase { testTimeoutConfiguration: TestTimeoutConfiguration(singleTestMaximumDuration: 0, testRunnerMaximumSilenceDuration: 0), testsToValidate: [], xcTestBundleLocation: testBundleLocation, - persistentMetricsJobId: "", remoteCache: NoOpRuntimeDumpRemoteCache() ) private lazy var tempFolder = assertDoesNotThrow { try TemporaryFolder() } diff --git a/Tests/TestDiscoveryTests/ParseFunctionSymbolsTestDiscovererTests.swift b/Tests/TestDiscoveryTests/ParseFunctionSymbolsTestDiscovererTests.swift index f8ea468a0..ab4ddf045 100644 --- a/Tests/TestDiscoveryTests/ParseFunctionSymbolsTestDiscovererTests.swift +++ b/Tests/TestDiscoveryTests/ParseFunctionSymbolsTestDiscovererTests.swift @@ -100,7 +100,6 @@ final class ParseFunctionSymbolsTestDiscovererTests: XCTestCase { testTimeoutConfiguration: TestTimeoutConfiguration(singleTestMaximumDuration: 0, testRunnerMaximumSilenceDuration: 0), testsToValidate: [], xcTestBundleLocation: testBundleLocation, - persistentMetricsJobId: "", remoteCache: NoOpRuntimeDumpRemoteCache() ) } diff --git a/Tests/TestDiscoveryTests/TestDiscoveryQuerierTests.swift b/Tests/TestDiscoveryTests/TestDiscoveryQuerierTests.swift index 71c69d4c1..e157f6282 100644 --- a/Tests/TestDiscoveryTests/TestDiscoveryQuerierTests.swift +++ b/Tests/TestDiscoveryTests/TestDiscoveryQuerierTests.swift @@ -254,7 +254,6 @@ final class TestDiscoveryQuerierTests: XCTestCase { ), testsToValidate: testsToValidate, xcTestBundleLocation: xcTestBundleLocation, - persistentMetricsJobId: "", remoteCache: remoteCache ) }