diff --git a/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs b/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs
index b31d7463a9..f0359712de 100644
--- a/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs
@@ -55,7 +55,7 @@ public void HandleMultiTestRunFinalizationProgress(MultiTestRunFinalizationProgr
}
///
- public void HandleFinalisedAttachments(IEnumerable attachments)
+ public void HandleProcessedAttachmentsChunk(IEnumerable attachments)
{
throw new System.NotImplementedException();
}
diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs
index af23cbcaee..661090959f 100644
--- a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs
+++ b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs
@@ -28,15 +28,15 @@ public class MultiTestRunFinalizationManager : IMultiTestRunFinalizationManager
private static string FinalizationFailed = "Failed";
private readonly ITestPlatformEventSource testPlatformEventSource;
- private readonly IDataCollectorAttachments[] dataCollectorAttachmentsHandlers;
+ private readonly IDataCollectorAttachmentProcessor[] dataCollectorAttachmentsProcessors;
///
/// Initializes a new instance of the class.
///
- public MultiTestRunFinalizationManager(ITestPlatformEventSource testPlatformEventSource, params IDataCollectorAttachments[] dataCollectorAttachmentsHandlers)
+ public MultiTestRunFinalizationManager(ITestPlatformEventSource testPlatformEventSource, params IDataCollectorAttachmentProcessor[] dataCollectorAttachmentsProcessors)
{
this.testPlatformEventSource = testPlatformEventSource ?? throw new ArgumentNullException(nameof(testPlatformEventSource));
- this.dataCollectorAttachmentsHandlers = dataCollectorAttachmentsHandlers ?? throw new ArgumentNullException(nameof(dataCollectorAttachmentsHandlers));
+ this.dataCollectorAttachmentsProcessors = dataCollectorAttachmentsProcessors ?? throw new ArgumentNullException(nameof(dataCollectorAttachmentsProcessors));
}
///
@@ -64,10 +64,7 @@ private async Task> InternalFinalizeMultiTestRunAsync(
var taskCompletionSource = new TaskCompletionSource>();
using (cancellationToken.Register(() => taskCompletionSource.TrySetCanceled()))
{
- Task> task = Task.Run(() =>
- {
- return ProcessAttachments(new Collection(attachments.ToList()), eventHandler, cancellationToken);
- });
+ Task> task = Task.Run(async () => await ProcessAttachmentsAsync(new Collection(attachments.ToList()), eventHandler, cancellationToken));
var completedTask = await Task.WhenAny(task, taskCompletionSource.Task).ConfigureAwait(false);
@@ -77,7 +74,7 @@ private async Task> InternalFinalizeMultiTestRunAsync(
}
else
{
- eventHandler?.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Informational, "Finalization was cancelled.");
+ eventHandler?.HandleLogMessage(TestMessageLevel.Informational, "Finalization was cancelled.");
return FinalizeOperation(requestData, new MultiTestRunFinalizationCompleteEventArgs(true, null), attachments, stopwatch, eventHandler);
}
}
@@ -94,26 +91,26 @@ private async Task> InternalFinalizeMultiTestRunAsync(
{
EqtTrace.Error("MultiTestRunFinalizationManager: Exception in FinalizeMultiTestRunAsync: " + e);
- eventHandler?.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Error, e.Message);
+ eventHandler?.HandleLogMessage(TestMessageLevel.Error, e.Message);
return FinalizeOperation(requestData, new MultiTestRunFinalizationCompleteEventArgs(false, e), attachments, stopwatch, eventHandler);
}
}
- private Collection ProcessAttachments(Collection attachments, IMultiTestRunFinalizationEventsHandler eventsHandler, CancellationToken cancellationToken)
+ private async Task> ProcessAttachmentsAsync(Collection attachments, IMultiTestRunFinalizationEventsHandler eventsHandler, CancellationToken cancellationToken)
{
if (attachments == null || !attachments.Any()) return attachments;
var logger = CreateMessageLogger(eventsHandler);
- for (int i = 0; i < dataCollectorAttachmentsHandlers.Length; i++)
+ for (int i = 0; i < dataCollectorAttachmentsProcessors.Length; i++)
{
- IDataCollectorAttachments dataCollectorAttachmentsHandler = dataCollectorAttachmentsHandlers[i];
+ var dataCollectorAttachmentsProcessor = dataCollectorAttachmentsProcessors[i];
int attachmentsHandlerIndex = i + 1;
- Uri attachementUri = dataCollectorAttachmentsHandler.GetExtensionUri();
- if (attachementUri != null)
+ ICollection attachementProcessorUris = dataCollectorAttachmentsProcessor.GetExtensionUris()?.ToList();
+ if (attachementProcessorUris != null && attachementProcessorUris.Any())
{
- var attachmentsToBeProcessed = attachments.Where(dataCollectionAttachment => attachementUri.Equals(dataCollectionAttachment.Uri)).ToArray();
+ var attachmentsToBeProcessed = attachments.Where(dataCollectionAttachment => attachementProcessorUris.Any(uri => uri.Equals(dataCollectionAttachment.Uri))).ToArray();
if (attachmentsToBeProcessed.Any())
{
foreach (var attachment in attachmentsToBeProcessed)
@@ -123,9 +120,9 @@ private Collection ProcessAttachments(Collection a
IProgress progressReporter = new Progress((int progress) =>
eventsHandler?.HandleMultiTestRunFinalizationProgress(
- new MultiTestRunFinalizationProgressEventArgs(attachmentsHandlerIndex, dataCollectorAttachmentsHandler.GetExtensionUri(), progress, dataCollectorAttachmentsHandlers.Length)));
+ new MultiTestRunFinalizationProgressEventArgs(attachmentsHandlerIndex, attachementProcessorUris, progress, dataCollectorAttachmentsProcessors.Length)));
- ICollection processedAttachments = dataCollectorAttachmentsHandler.HandleDataCollectionAttachmentSets(new Collection(attachmentsToBeProcessed), progressReporter, logger, cancellationToken);
+ ICollection processedAttachments = await dataCollectorAttachmentsProcessor.ProcessAttachmentSetsAsync(new Collection(attachmentsToBeProcessed), progressReporter, logger, cancellationToken).ConfigureAwait(false);
foreach (var attachment in processedAttachments)
{
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationCompleteEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationCompleteEventArgs.cs
index 4f73073caa..0ca669e6a1 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationCompleteEventArgs.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationCompleteEventArgs.cs
@@ -34,7 +34,7 @@ public MultiTestRunFinalizationCompleteEventArgs(bool isCanceled, Exception erro
public Exception Error { get; private set; }
///
- /// Get or Sets the Metrics
+ /// Get or Sets the Metrics (used for telemetry)
///
[DataMember]
public IDictionary Metrics { get; set; }
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationProgressEventArgs.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationProgressEventArgs.cs
index 529be7baaf..9710add944 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationProgressEventArgs.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Events/MultiTestRunFinalizationProgressEventArgs.cs
@@ -4,6 +4,7 @@
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client
{
using System;
+ using System.Collections.Generic;
using System.Runtime.Serialization;
[DataContract]
@@ -12,40 +13,40 @@ public class MultiTestRunFinalizationProgressEventArgs : EventArgs
///
/// Default constructor.
///
- /// Specifies current handler index.
- /// Specifies current handler Uri.
- /// Specifies current handler progress.
- /// Specifies the overall number of handlers.
- public MultiTestRunFinalizationProgressEventArgs(long currentHandlerIndex, Uri currentHandlerUri, long currentHandlerProgress, long handlersCount)
+ /// Specifies current attachment processor index.
+ /// Specifies current processor Uris.
+ /// Specifies current processor progress.
+ /// Specifies the overall number of processors.
+ public MultiTestRunFinalizationProgressEventArgs(long currentAttachmentProcessorIndex, ICollection currentAttachmentProcessorUris, long currentAttachmentProcessorProgress, long attachmentProcessorsCount)
{
- CurrentHandlerIndex = currentHandlerIndex;
- CurrentHandlerUri = currentHandlerUri;
- CurrentHandlerProgress = currentHandlerProgress;
- HandlersCount = handlersCount;
+ CurrentAttachmentProcessorIndex = currentAttachmentProcessorIndex;
+ CurrentAttachmentProcessorUris = currentAttachmentProcessorUris;
+ CurrentAttachmentProcessorProgress = currentAttachmentProcessorProgress;
+ AttachmentProcessorsCount = attachmentProcessorsCount;
}
///
- /// Gets a current handler index.
+ /// Gets a current attachment processor index.
///
[DataMember]
- public long CurrentHandlerIndex { get; private set; }
+ public long CurrentAttachmentProcessorIndex { get; private set; }
///
- /// Gets a current handler URI.
+ /// Gets a current attachment processor URI.
///
[DataMember]
- public Uri CurrentHandlerUri { get; private set; }
+ public ICollection CurrentAttachmentProcessorUris { get; private set; }
///
- /// Gets a current handler progress.
+ /// Gets a current attachment processor progress.
///
[DataMember]
- public long CurrentHandlerProgress { get; private set; }
+ public long CurrentAttachmentProcessorProgress { get; private set; }
///
- /// Gets the overall number of handlers.
+ /// Gets the overall number of attachment processors.
///
[DataMember]
- public long HandlersCount { get; private set; }
+ public long AttachmentProcessorsCount { get; private set; }
}
}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IMultiTestRunFinalizationEventsHandler.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IMultiTestRunFinalizationEventsHandler.cs
index 8c00b00c60..3983bd571e 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IMultiTestRunFinalizationEventsHandler.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Interfaces/IMultiTestRunFinalizationEventsHandler.cs
@@ -6,7 +6,7 @@
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client
{
///
- /// Interface contract for handling multi test run finalization complete events
+ /// Interface contract for handling multi test run finalization events
///
public interface IMultiTestRunFinalizationEventsHandler : ITestMessageEventHandler
{
@@ -18,10 +18,10 @@ public interface IMultiTestRunFinalizationEventsHandler : ITestMessageEventHandl
void HandleMultiTestRunFinalizationComplete(MultiTestRunFinalizationCompleteEventArgs finalizationCompleteEventArgs, IEnumerable lastChunk);
///
- /// Dispatch FinalisedAttachments event to listeners.
+ /// Dispatch ProcessedAttachmentsChunk event to listeners.
///
- /// Finalised attachment sets.
- void HandleFinalisedAttachments(IEnumerable attachments);
+ /// Processed attachment sets.
+ void HandleProcessedAttachmentsChunk(IEnumerable attachments);
///
/// Dispatch MultiTestRunFinalizationProgress event to listeners.
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachmentProcessor.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachmentProcessor.cs
new file mode 100644
index 0000000000..7b996d950d
--- /dev/null
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachmentProcessor.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
+
+ ///
+ /// Interface for data collectors add-ins that choose to reprocess generated attachments
+ ///
+ public interface IDataCollectorAttachmentProcessor
+ {
+ ///
+ /// Gets the attachments Uris, which are handled by attachment processor
+ ///
+ IEnumerable GetExtensionUris();
+
+ ///
+ /// Indicates whether attachment processor is supporting incremental processing of attachments
+ ///
+ bool SupportsIncrementalProcessing { get; }
+
+ ///
+ /// Reprocess attachments generated by independent test executions
+ ///
+ /// Attachments to be processed
+ /// Progress reporter. Accepts integers from 0 to 100
+ /// Message logger
+ /// Cancellation token
+ /// Attachments after reprocessing
+ Task> ProcessAttachmentSetsAsync(ICollection attachments, IProgress progressReporter, IMessageLogger logger, CancellationToken cancellationToken);
+ }
+}
diff --git a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachments.cs b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachments.cs
index cd9124743b..a342d74ea6 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachments.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/DataCollector/IDataCollectorAttachments.cs
@@ -3,14 +3,13 @@
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection
{
- using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using System;
using System.Collections.Generic;
- using System.Threading;
///
/// Interface for data collectors add-ins that choose to handle attachment(s) generated
///
+ [Obsolete("Interface is deprecated. Please use IDataCollectorAttachmentProcessor instead")]
public interface IDataCollectorAttachments
{
///
@@ -19,15 +18,6 @@ public interface IDataCollectorAttachments
/// Gets the attachment set after Test Run Session
ICollection HandleDataCollectionAttachmentSets(ICollection dataCollectionAttachments);
- ///
- /// Gets the attachment set after Test Run Session
- ///
- /// Attachments to be processed
- /// Progress reporter. Accepts integers from 0 to 100
- /// Cancellation token
- /// Gets the attachment set after Test Run Session
- ICollection HandleDataCollectionAttachmentSets(ICollection dataCollectionAttachments, IProgress progressReporter, IMessageLogger logger, CancellationToken cancellationToken);
-
///
/// Gets the attachment Uri, which is handled by current Collector
///
diff --git a/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs b/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs
index d31fda0a56..2b911f6926 100644
--- a/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs
+++ b/src/Microsoft.TestPlatform.Utilities/CodeCoverageDataAttachmentsHandler.cs
@@ -10,12 +10,13 @@ namespace Microsoft.VisualStudio.TestPlatform.Utilities
using System.Linq;
using System.Reflection;
using System.Threading;
+ using System.Threading.Tasks;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
- public class CodeCoverageDataAttachmentsHandler : IDataCollectorAttachments
+ public class CodeCoverageDataAttachmentsHandler : IDataCollectorAttachmentProcessor
{
private const string CoverageUri = "datacollector://microsoft/CodeCoverage/2.0";
private const string CoverageFileExtension = ".coverage";
@@ -27,35 +28,32 @@ public class CodeCoverageDataAttachmentsHandler : IDataCollectorAttachments
private static readonly Uri CodeCoverageDataCollectorUri = new Uri(CoverageUri);
- public Uri GetExtensionUri()
- {
- return CodeCoverageDataCollectorUri;
- }
+ public bool SupportsIncrementalProcessing => true;
- public ICollection HandleDataCollectionAttachmentSets(ICollection dataCollectionAttachments)
+ public IEnumerable GetExtensionUris()
{
- return HandleDataCollectionAttachmentSets(dataCollectionAttachments, null, null, CancellationToken.None);
- }
+ yield return CodeCoverageDataCollectorUri;
+ }
- public ICollection HandleDataCollectionAttachmentSets(ICollection dataCollectionAttachments, IProgress progressReporter, IMessageLogger logger, CancellationToken cancellationToken)
+ public Task> ProcessAttachmentSetsAsync(ICollection attachments, IProgress progressReporter, IMessageLogger logger, CancellationToken cancellationToken)
{
- if (dataCollectionAttachments != null && dataCollectionAttachments.Any())
+ if (attachments != null && attachments.Any())
{
- var codeCoverageFiles = dataCollectionAttachments.Select(coverageAttachment => coverageAttachment.Attachments[0].Uri.LocalPath).ToArray();
+ var codeCoverageFiles = attachments.Select(coverageAttachment => coverageAttachment.Attachments[0].Uri.LocalPath).ToArray();
var outputFile = MergeCodeCoverageFiles(codeCoverageFiles, progressReporter, cancellationToken);
var attachmentSet = new AttachmentSet(CodeCoverageDataCollectorUri, CoverageFriendlyName);
if (!string.IsNullOrEmpty(outputFile))
{
attachmentSet.Attachments.Add(new UriDataAttachment(new Uri(outputFile), CoverageFriendlyName));
- return new Collection { attachmentSet };
+ return Task.FromResult((ICollection)new Collection { attachmentSet });
}
// In case merging fails(esp in dotnet core we cannot merge), so return filtered list of Code Coverage Attachments
- return dataCollectionAttachments;
+ return Task.FromResult(attachments);
}
- return new Collection();
+ return Task.FromResult((ICollection)new Collection());
}
private string MergeCodeCoverageFiles(IList files, IProgress progressReporter, CancellationToken cancellationToken)
diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs
index 56e322d711..d9f67417cf 100644
--- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs
+++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs
@@ -81,9 +81,10 @@ public interface IVsTestConsoleWrapperAsync
/// Provides back all attachments to TestPlatform for additional processing (for example merging)
///
/// Collection of attachments
- /// Enables metrics collection
- /// EventHandler to receive session complete event
+ /// Indicates that all test executions are done and all data is provided
+ /// Enables metrics collection (used for telemetry)
+ /// EventHandler to receive session complete event
/// Cancellation token
- Task FinalizeMultiTestRunAsync(IEnumerable attachments, bool collectMetrics, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken);
+ Task FinalizeMultiTestRunAsync(IEnumerable attachments, bool multiTestRunCompleted, bool collectMetrics, IMultiTestRunFinalizationEventsHandler eventsHandler, CancellationToken cancellationToken);
}
}
diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs
index 116a9d3240..e2750b80fe 100644
--- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs
+++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs
@@ -407,7 +407,7 @@ public async Task RunTestsWithCustomTestHostAsync(IEnumerable testCase
}
///
- public async Task FinalizeMultiTestRunAsync(IEnumerable attachments, bool collectMetrics, IMultiTestRunFinalizationEventsHandler testSessionEventsHandler, CancellationToken cancellationToken)
+ public async Task FinalizeMultiTestRunAsync(IEnumerable attachments, bool multiTestRunCompleted, bool collectMetrics, IMultiTestRunFinalizationEventsHandler testSessionEventsHandler, CancellationToken cancellationToken)
{
this.testPlatformEventSource.TranslationLayerMultiTestRunFinalizationStart();
diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs
index 6d2047e105..cc3c7efe62 100644
--- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs
+++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/CodeCoverageTests.cs
@@ -104,7 +104,7 @@ public async Task TestRunWithCodeCoverageAndFinalization(RunnerInfo runnerInfo)
Assert.AreEqual(2, this.runEventHandler.Attachments.Count);
// act
- await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
+ await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
// Assert
multiTestRunFinalizationEventHandler.EnsureSuccess();
@@ -118,12 +118,13 @@ public async Task TestRunWithCodeCoverageAndFinalization(RunnerInfo runnerInfo)
for (int i = 0; i < multiTestRunFinalizationEventHandler.ProgressArgs.Count; i++)
{
VisualStudio.TestPlatform.ObjectModel.Client.MultiTestRunFinalizationProgressEventArgs progressArgs = multiTestRunFinalizationEventHandler.ProgressArgs[i];
- Assert.AreEqual(1, progressArgs.CurrentHandlerIndex);
- Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentHandlerUri.AbsoluteUri);
- Assert.AreEqual(1, progressArgs.HandlersCount);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorIndex);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorUris.Count);
+ Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentAttachmentProcessorUris.First().AbsoluteUri);
+ Assert.AreEqual(1, progressArgs.AttachmentProcessorsCount);
if (multiTestRunFinalizationEventHandler.ProgressArgs.Count == 2)
{
- Assert.AreEqual(i == 0 ? 50 : 100, progressArgs.CurrentHandlerProgress);
+ Assert.AreEqual(i == 0 ? 50 : 100, progressArgs.CurrentAttachmentProcessorProgress);
}
}
@@ -152,7 +153,7 @@ public async Task TestRunWithCodeCoverageAndFinalizationNoMetrics(RunnerInfo run
Assert.AreEqual(2, this.runEventHandler.Attachments.Count);
// act
- await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, false, multiTestRunFinalizationEventHandler, CancellationToken.None);
+ await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, false, multiTestRunFinalizationEventHandler, CancellationToken.None);
// Assert
multiTestRunFinalizationEventHandler.EnsureSuccess();
@@ -166,12 +167,13 @@ public async Task TestRunWithCodeCoverageAndFinalizationNoMetrics(RunnerInfo run
for (int i = 0; i < multiTestRunFinalizationEventHandler.ProgressArgs.Count; i++)
{
VisualStudio.TestPlatform.ObjectModel.Client.MultiTestRunFinalizationProgressEventArgs progressArgs = multiTestRunFinalizationEventHandler.ProgressArgs[i];
- Assert.AreEqual(1, progressArgs.CurrentHandlerIndex);
- Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentHandlerUri.AbsoluteUri);
- Assert.AreEqual(1, progressArgs.HandlersCount);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorIndex);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorUris.Count);
+ Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentAttachmentProcessorUris.First().AbsoluteUri);
+ Assert.AreEqual(1, progressArgs.AttachmentProcessorsCount);
if (multiTestRunFinalizationEventHandler.ProgressArgs.Count == 2)
{
- Assert.AreEqual(i == 0 ? 50 : 100, progressArgs.CurrentHandlerProgress);
+ Assert.AreEqual(i == 0 ? 50 : 100, progressArgs.CurrentAttachmentProcessorProgress);
}
}
@@ -198,7 +200,7 @@ public async Task TestRunWithCodeCoverageAndFinalizationModuleDuplicated(RunnerI
Assert.AreEqual(3, this.runEventHandler.Attachments.Count);
// act
- await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
+ await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
// Assert
multiTestRunFinalizationEventHandler.EnsureSuccess();
@@ -212,13 +214,13 @@ public async Task TestRunWithCodeCoverageAndFinalizationModuleDuplicated(RunnerI
for (int i = 0; i < multiTestRunFinalizationEventHandler.ProgressArgs.Count; i++)
{
VisualStudio.TestPlatform.ObjectModel.Client.MultiTestRunFinalizationProgressEventArgs progressArgs = multiTestRunFinalizationEventHandler.ProgressArgs[i];
- Assert.AreEqual(1, progressArgs.CurrentHandlerIndex);
- Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentHandlerUri.AbsoluteUri);
- Assert.AreEqual(1, progressArgs.HandlersCount);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorIndex);
+ Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentAttachmentProcessorUris.First().AbsoluteUri);
+ Assert.AreEqual(1, progressArgs.AttachmentProcessorsCount);
if (multiTestRunFinalizationEventHandler.ProgressArgs.Count == 3)
{
- Assert.AreEqual(i == 0 ? 33 : i == 1 ? 66 : 100, progressArgs.CurrentHandlerProgress);
+ Assert.AreEqual(i == 0 ? 33 : i == 1 ? 66 : 100, progressArgs.CurrentAttachmentProcessorProgress);
}
}
@@ -250,7 +252,7 @@ public async Task TestRunWithCodeCoverageAndFinalizationCancelled(RunnerInfo run
CancellationTokenSource cts = new CancellationTokenSource();
- Task finalization = this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(attachments, true, multiTestRunFinalizationEventHandler, cts.Token);
+ Task finalization = this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(attachments, true, true, multiTestRunFinalizationEventHandler, cts.Token);
while (true)
{
@@ -282,13 +284,13 @@ public async Task TestRunWithCodeCoverageAndFinalizationCancelled(RunnerInfo run
for (int i = 0; i < multiTestRunFinalizationEventHandler.ProgressArgs.Count; i++)
{
VisualStudio.TestPlatform.ObjectModel.Client.MultiTestRunFinalizationProgressEventArgs progressArgs = multiTestRunFinalizationEventHandler.ProgressArgs[i];
- Assert.AreEqual(1, progressArgs.CurrentHandlerIndex);
- Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentHandlerUri.AbsoluteUri);
- Assert.AreEqual(1, progressArgs.HandlersCount);
+ Assert.AreEqual(1, progressArgs.CurrentAttachmentProcessorIndex);
+ Assert.AreEqual("datacollector://microsoft/CodeCoverage/2.0", progressArgs.CurrentAttachmentProcessorUris.First().AbsoluteUri);
+ Assert.AreEqual(1, progressArgs.AttachmentProcessorsCount);
if (i == 0)
{
- Assert.AreEqual(0, progressArgs.CurrentHandlerProgress);
+ Assert.AreEqual(0, progressArgs.CurrentAttachmentProcessorProgress);
}
}
@@ -316,7 +318,7 @@ public async Task EndSessionShouldEnsureVstestConsoleProcessDies(RunnerInfo runn
Assert.AreEqual(6, this.runEventHandler.TestResults.Count);
Assert.AreEqual(2, this.runEventHandler.Attachments.Count);
- await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
+ await this.vstestConsoleWrapper.FinalizeMultiTestRunAsync(runEventHandler.Attachments, true, true, multiTestRunFinalizationEventHandler, CancellationToken.None);
// act
this.vstestConsoleWrapper?.EndSession();
diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/MultiTestRunFinalizationEventHandler.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/MultiTestRunFinalizationEventHandler.cs
index 0c867da64e..ed3fc68204 100644
--- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/MultiTestRunFinalizationEventHandler.cs
+++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/MultiTestRunFinalizationEventHandler.cs
@@ -96,7 +96,7 @@ public void HandleMultiTestRunFinalizationComplete(MultiTestRunFinalizationCompl
CompleteArgs = finalizationCompleteEventArgs;
}
- public void HandleFinalisedAttachments(IEnumerable attachments)
+ public void HandleProcessedAttachmentsChunk(IEnumerable attachments)
{
throw new NotImplementedException();
}
diff --git a/test/Microsoft.TestPlatform.Client.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandlerTests.cs b/test/Microsoft.TestPlatform.Client.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandlerTests.cs
index a15f47e09e..852554361c 100644
--- a/test/Microsoft.TestPlatform.Client.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandlerTests.cs
+++ b/test/Microsoft.TestPlatform.Client.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandlerTests.cs
@@ -48,7 +48,7 @@ public void EventsHandlerHandleMultiTestRunFinalizationCompleteShouldSendFinaliz
[TestMethod]
public void EventsHandlerHandleMultiTestRunFinalizationProgressShouldSendFinalizationProgressMessage()
{
- var args = new MultiTestRunFinalizationProgressEventArgs(1, new System.Uri("http://www.bing.com/"), 90, 2);
+ var args = new MultiTestRunFinalizationProgressEventArgs(1, new[] { new System.Uri("http://www.bing.com/") }, 90, 2);
handler.HandleMultiTestRunFinalizationProgress(args);
diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationManagerTests.cs
index 0b5c678a8a..a8f7aa866e 100644
--- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationManagerTests.cs
+++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/MultiTestRunFinalization/MultiTestRunFinalizationManagerTests.cs
@@ -28,8 +28,8 @@ public class MultiTestRunFinalizationManagerTests
private readonly Mock mockRequestData;
private readonly Mock mockMetricsCollection;
private readonly Mock mockEventSource;
- private readonly Mock mockAttachmentHandler1;
- private readonly Mock mockAttachmentHandler2;
+ private readonly Mock mockAttachmentHandler1;
+ private readonly Mock mockAttachmentHandler2;
private readonly Mock mockEventsHandler;
private readonly MultiTestRunFinalizationManager manager;
private readonly CancellationTokenSource cancellationTokenSource;
@@ -41,12 +41,12 @@ public MultiTestRunFinalizationManagerTests()
mockRequestData.Setup(r => r.MetricsCollection).Returns(mockMetricsCollection.Object);
mockEventSource = new Mock();
- mockAttachmentHandler1 = new Mock();
- mockAttachmentHandler2 = new Mock();
+ mockAttachmentHandler1 = new Mock();
+ mockAttachmentHandler2 = new Mock();
mockEventsHandler = new Mock();
- mockAttachmentHandler1.Setup(h => h.GetExtensionUri()).Returns(new Uri(uri1));
- mockAttachmentHandler2.Setup(h => h.GetExtensionUri()).Returns(new Uri(uri2));
+ mockAttachmentHandler1.Setup(h => h.GetExtensionUris()).Returns(new[] { new Uri(uri1) });
+ mockAttachmentHandler2.Setup(h => h.GetExtensionUris()).Returns(new[] { new Uri(uri2) });
manager = new MultiTestRunFinalizationManager(mockEventSource.Object, mockAttachmentHandler1.Object, mockAttachmentHandler2.Object);
@@ -69,10 +69,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachmentsThroug
mockEventsHandler.Verify(h => h.HandleMultiTestRunFinalizationProgress(It.IsAny()), Times.Never);
mockEventSource.Verify(s => s.MultiTestRunFinalizationStart(0));
mockEventSource.Verify(s => s.MultiTestRunFinalizationStop(0));
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(0, 0);
}
@@ -88,10 +88,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnNoAttachments_IfNoAttach
// assert
Assert.AreEqual(0, result.Count);
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(0, 0);
}
@@ -112,10 +112,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1NotProcessedAttachmentT
VerifyCompleteEvent(false, false, inputAttachments[0]);
mockEventsHandler.Verify(h => h.HandleMultiTestRunFinalizationProgress(It.IsAny()), Times.Never);
mockEventsHandler.Verify(h => h.HandleLogMessage(It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1);
}
@@ -135,10 +135,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1NotProcessedAttachment_
// assert
Assert.AreEqual(1, result.Count);
Assert.IsTrue(result.Contains(inputAttachments[0]));
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1);
}
@@ -157,7 +157,7 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1ProcessedAttachmentThro
new AttachmentSet(new Uri(uri1), "uri1_output")
};
- mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Returns(outputAttachments);
+ mockAttachmentHandler1.Setup(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).ReturnsAsync(outputAttachments);
// act
await manager.FinalizeMultiTestRunAsync(mockRequestData.Object, inputAttachments, mockEventsHandler.Object, cancellationTokenSource.Token);
@@ -166,10 +166,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1ProcessedAttachmentThro
VerifyCompleteEvent(false, false, outputAttachments[0]);
mockEventsHandler.Verify(h => h.HandleMultiTestRunFinalizationProgress(It.IsAny()), Times.Never);
mockEventsHandler.Verify(h => h.HandleLogMessage(It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1);
}
@@ -188,7 +188,7 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1ProcessedAttachment_IfR
new AttachmentSet(new Uri(uri1), "uri1_output")
};
- mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Returns(outputAttachments);
+ mockAttachmentHandler1.Setup(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).ReturnsAsync(outputAttachments);
// act
var result = await manager.FinalizeMultiTestRunAsync(mockRequestData.Object, inputAttachments, cancellationTokenSource.Token);
@@ -198,10 +198,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturn1ProcessedAttachment_IfR
Assert.IsTrue(result.Contains(outputAttachments[0]));
mockEventSource.Verify(s => s.MultiTestRunFinalizationStart(1));
mockEventSource.Verify(s => s.MultiTestRunFinalizationStop(1));
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1);
}
@@ -215,7 +215,7 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachmentsThroug
new AttachmentSet(new Uri(uri1), "uri1_input")
};
- mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Throws(new Exception("exception message"));
+ mockAttachmentHandler1.Setup(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Throws(new Exception("exception message"));
// act
await manager.FinalizeMultiTestRunAsync(mockRequestData.Object, inputAttachments, mockEventsHandler.Object, cancellationTokenSource.Token);
@@ -224,10 +224,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachmentsThroug
VerifyCompleteEvent(false, true, inputAttachments[0]);
mockEventsHandler.Verify(h => h.HandleMultiTestRunFinalizationProgress(It.IsAny()), Times.Never);
mockEventsHandler.Verify(h => h.HandleLogMessage(TestMessageLevel.Error, "exception message"), Times.Once);
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1, "Failed");
}
@@ -241,7 +241,7 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachments_IfRel
new AttachmentSet(new Uri(uri1), "uri1_input")
};
- mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Throws(new Exception("exception message"));
+ mockAttachmentHandler1.Setup(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Throws(new Exception("exception message"));
// act
var result = await manager.FinalizeMultiTestRunAsync(mockRequestData.Object, inputAttachments, cancellationTokenSource.Token);
@@ -249,10 +249,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachments_IfRel
// assert
Assert.AreEqual(1, result.Count);
Assert.IsTrue(result.Contains(inputAttachments[0]));
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri());
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris());
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.Is>(c => c.Count == 1 && c.Contains(inputAttachments[0])), It.IsAny>(), It.IsAny(), cancellationTokenSource.Token));
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1, "Failed");
}
@@ -273,10 +273,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachmentsThroug
// assert
VerifyCompleteEvent(true, false, inputAttachments[0]);
mockEventsHandler.Verify(h => h.HandleMultiTestRunFinalizationProgress(It.IsAny()), Times.Never);
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1, "Canceled");
}
@@ -297,10 +297,10 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnInitialAttachments_IfOpe
// assert
Assert.AreEqual(1, result.Count);
Assert.IsTrue(result.Contains(inputAttachments[0]));
- mockAttachmentHandler1.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler2.Verify(h => h.GetExtensionUri(), Times.Never);
- mockAttachmentHandler1.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
- mockAttachmentHandler2.Verify(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.GetExtensionUris(), Times.Never);
+ mockAttachmentHandler1.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
+ mockAttachmentHandler2.Verify(h => h.ProcessAttachmentSetsAsync(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny()), Times.Never);
VerifyMetrics(1, 1, "Canceled");
}
@@ -328,8 +328,8 @@ public async Task FinalizeMultiTestRunAsync_ShouldReturnProcessedAttachmentsThro
new AttachmentSet(new Uri(uri2), "uri2_output")
};
- mockAttachmentHandler1.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny(), It.IsAny())).Returns(outputAttachmentsForHandler1);
- mockAttachmentHandler2.Setup(h => h.HandleDataCollectionAttachmentSets(It.IsAny>(), It.IsAny>(), It.IsAny