Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed Jun 16, 2020
1 parent bbb2244 commit 4d61a92
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.MultiTestRunFinalization
using System.Collections.Generic;

/// <summary>
/// The multi test finalization event handler.
/// The multi test finalization events handler.
/// </summary>
public class MultiTestRunFinalizationEventsHandler : IMultiTestRunFinalizationEventsHandler
{
Expand All @@ -20,23 +20,20 @@ public class MultiTestRunFinalizationEventsHandler : IMultiTestRunFinalizationEv
/// <summary>
/// Initializes a new instance of the <see cref="MultiTestRunFinalizationEventsHandler"/> class.
/// </summary>
/// <param name="requestHandler"> The Request Handler. </param>
/// <param name="communicationManager"> The communication manager. </param>
public MultiTestRunFinalizationEventsHandler(ICommunicationManager communicationManager)
{
this.communicationManager = communicationManager;
}

/// <summary>
/// The handle discovery message.
/// </summary>
/// <param name="level"> Logging level. </param>
/// <param name="message"> Logging message. </param>
/// <inheritdoc/>
public void HandleLogMessage(TestMessageLevel level, string message)
{
var testMessagePayload = new TestMessagePayload { MessageLevel = level, Message = message };
this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload);
}

/// <inheritdoc/>
public void HandleMultiTestRunFinalizationComplete(ICollection<AttachmentSet> attachments)
{
if (EqtTrace.IsInfoEnabled)
Expand All @@ -53,6 +50,7 @@ public void HandleMultiTestRunFinalizationComplete(ICollection<AttachmentSet> at
this.communicationManager.SendMessage(MessageType.MultiTestRunFinalizationComplete, payload);
}

/// <inheritdoc/>
public void HandleRawMessage(string rawMessage)
{
// No-Op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ internal interface IMultiTestRunFinalizationManager
/// <summary>
/// Finalizes multi test run and provides results through handler
/// </summary>
/// <param name="attachments">Attachments</param>
/// <param name="eventHandler">EventHandler for handling multi test run finalization events from Engine</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="eventHandler">EventHandler for handling multi test run finalization event</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler eventHandler, CancellationToken cancellationToken);

/// <summary>
/// Finalizes multi test
/// Finalizes multi test run
/// </summary>
/// <param name="attachments">Attachments</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Collection of attachments.</returns>
Task<Collection<AttachmentSet>> FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, CancellationToken cancellationToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,18 @@ public interface ITestPlatformEventSource
/// <summary>
/// The multi test run finalization start.
/// </summary>
/// <param name="numberOfAttachements">
/// The number of attachements.
/// <param name="numberOfAttachments">
/// The number of attachments.
/// </param>
void MultiTestRunFinalizationStart(long numberOfAttachements);
void MultiTestRunFinalizationStart(long numberOfAttachments);

/// <summary>
/// The multi test run finalization stop.
/// </summary>
/// <param name="numberOfAttachements">
/// The number of attachements.
/// <param name="numberOfAttachments">
/// The number of attachments.
/// </param>
void MultiTestRunFinalizationStop(long numberOfAttachements);
void MultiTestRunFinalizationStop(long numberOfAttachments);

/// <summary>
/// Mark the start of translation layer multi test run finalization request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ public void MultiTestRunFinalizationRequestStop()

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId)]
public void MultiTestRunFinalizationStart(long numberOfAttachements)
public void MultiTestRunFinalizationStart(long numberOfAttachments)
{
this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId, numberOfAttachements);
this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId, numberOfAttachments);
}

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId)]
public void MultiTestRunFinalizationStop(long numberOfAttachements)
public void MultiTestRunFinalizationStop(long numberOfAttachments)
{
this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId, numberOfAttachements);
this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId, numberOfAttachments);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.MultiTestRunFinalization
{
/// <summary>
/// Orchestrates multi test run finalization operations for the engine communicating with the test host process.
/// Orchestrates multi test run finalization operations.
/// </summary>
public class MultiTestRunFinalizationManager : IMultiTestRunFinalizationManager
{
Expand Down Expand Up @@ -60,7 +60,7 @@ private async Task<Collection<AttachmentSet>> InternalFinalizeMultiTestRunAsync(

Task task = Task.Run(() =>
{
HandleAttachements(attachments, cancellationToken);
HandleAttachments(attachments, cancellationToken);
});

var completedTask = await Task.WhenAny(task, taskCompletionSource.Task);
Expand Down Expand Up @@ -92,7 +92,7 @@ private async Task<Collection<AttachmentSet>> InternalFinalizeMultiTestRunAsync(
}
}

private void HandleAttachements(ICollection<AttachmentSet> attachments, CancellationToken cancellationToken)
private void HandleAttachments(ICollection<AttachmentSet> attachments, CancellationToken cancellationToken)
{
foreach (var dataCollectorAttachmentsHandler in dataCollectorAttachmentsHandlers)
{
Expand All @@ -107,8 +107,8 @@ private void HandleAttachements(ICollection<AttachmentSet> attachments, Cancella
attachments.Remove(attachment);
}

ICollection<AttachmentSet> processedAttachements = dataCollectorAttachmentsHandler.HandleDataCollectionAttachmentSets(new Collection<AttachmentSet>(attachmentsToBeProcessed), cancellationToken);
foreach (var attachment in processedAttachements)
ICollection<AttachmentSet> processedAttachments = dataCollectorAttachmentsHandler.HandleDataCollectionAttachmentSets(new Collection<AttachmentSet>(attachmentsToBeProcessed), cancellationToken);
foreach (var attachment in processedAttachments)
{
attachments.Add(attachment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client
public class MultiTestRunFinalizationPayload
{
/// <summary>
/// Settings used for the discovery request.
/// Collection of attachments.
/// </summary>
[DataMember]
public ICollection<AttachmentSet> Attachments { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ internal interface ITranslationLayerRequestSender : IDisposable
void CancelDiscovery();

/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// Provides back all attachments to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="multiTestRunFinalizationCompleteEventsHandler">Events handler</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ internal interface ITranslationLayerRequestSenderAsync : IDisposable
void OnProcessExited();

/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// Provides back all attachments to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="multiTestRunFinalizationCompleteEventsHandler">Events handler</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public interface IVsTestConsoleWrapper
void RunTestsWithCustomTestHost(IEnumerable<TestCase> testCases, string runSettings, TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher);

/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// Provides back all attachments to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="multiTestRunFinalizationCompleteEventsHandler">EventHandler to receive session complete event</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public interface IVsTestConsoleWrapperAsync
Task RunTestsWithCustomTestHostAsync(IEnumerable<TestCase> testCases, string runSettings, TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher);

/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// Provides back all attachments to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="attachments">Collection of attachments</param>
/// <param name="multiTestRunFinalizationCompleteEventsHandler">EventHandler to receive session complete event</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(ICollection<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ private async Task SendMessageAndListenAndReportFinalizationResultAsync(ICollect
{
if (EqtTrace.IsInfoEnabled)
{
EqtTrace.Info("VsTestConsoleRequestSender.SendMessageAndListenAndReportAttachements: Process complete.");
EqtTrace.Info("VsTestConsoleRequestSender.SendMessageAndListenAndReportAttachments: Process complete.");
}

var multiTestRunFinalizationCompletePayload = this.dataSerializer.DeserializePayload<MultiTestRunFinalizationCompletePayload>(message);
Expand Down
12 changes: 2 additions & 10 deletions src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,7 @@ public void RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLaunc
}
}

/// <summary>
/// Discover Tests given a list of sources, run settings.
/// </summary>
/// <param name="discoveryPayload">Discovery payload</param>
/// <param name="discoveryEventsRegistrar">EventHandler for discovered tests</param>
/// <param name="protocolConfig">Protocol related information</param>
/// <returns>True, if successful</returns>
/// <inheritdoc/>
public void FinalizeMultiTestRun(MultiTestRunFinalizationPayload finalizationPayload, IMultiTestRunFinalizationEventsHandler finalizationEventsHandler)
{
EqtTrace.Info("TestRequestManager.FinalizeMultiTestRun: Multi test run finalization started.");
Expand Down Expand Up @@ -392,9 +386,7 @@ public void AbortTestRun()
this.currentTestRunRequest?.Abort();
}

/// <summary>
/// Cancel the multi test run finalization.
/// </summary>
/// <inheritdoc/>
public void CancelMultiTestRunFinalization()
{
EqtTrace.Info("TestRequestManager.CancelMultiTestRunFinalization: Sending cancel request.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void ToTestElementShouldContainExpectedTestMethodPropertiesIfFqnDoesNotEn
}

[TestMethod]
public void ToResultFilesShouldAddAttachementsWithRelativeURI()
public void ToResultFilesShouldAddAttachmentsWithRelativeURI()
{
UriDataAttachment uriDataAttachment1 =
new UriDataAttachment(new Uri($"/mnt/c/abc.txt", UriKind.Relative), "Description 1");
Expand Down

0 comments on commit 4d61a92

Please sign in to comment.