From 4d61a921cc3f58df8d1bd07600a5cc5d9d4aca91 Mon Sep 17 00:00:00 2001 From: Jakub Chocholowicz Date: Tue, 16 Jun 2020 18:30:23 +0200 Subject: [PATCH] Fix comments --- .../MultiTestRunFinalizationEventsHandler.cs | 12 +++++------- .../Engine/IMultiTestRunFinalizationManager.cs | 9 +++++---- .../Tracing/Interfaces/ITestPlatformEventSource.cs | 12 ++++++------ .../Tracing/TestPlatformEventSource.cs | 8 ++++---- .../MultiTestRunFinalizationManager.cs | 10 +++++----- .../Payloads/MultiTestRunFinalizationPayload.cs | 2 +- .../Interfaces/ITranslationLayerRequestSender.cs | 4 ++-- .../ITranslationLayerRequestSenderAsync.cs | 4 ++-- .../Interfaces/IVsTestConsoleWrapper.cs | 4 ++-- .../Interfaces/IVsTestConsoleWrapperAsync.cs | 4 ++-- .../VsTestConsoleRequestSender.cs | 2 +- .../TestPlatformHelpers/TestRequestManager.cs | 12 ++---------- .../Utility/ConverterTests.cs | 2 +- 13 files changed, 38 insertions(+), 47 deletions(-) diff --git a/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs b/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs index 78cc89e1be..cc9c7cbcab 100644 --- a/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs +++ b/src/Microsoft.TestPlatform.Client/MultiTestRunFinalization/MultiTestRunFinalizationEventsHandler.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.MultiTestRunFinalization using System.Collections.Generic; /// - /// The multi test finalization event handler. + /// The multi test finalization events handler. /// public class MultiTestRunFinalizationEventsHandler : IMultiTestRunFinalizationEventsHandler { @@ -20,23 +20,20 @@ public class MultiTestRunFinalizationEventsHandler : IMultiTestRunFinalizationEv /// /// Initializes a new instance of the class. /// - /// The Request Handler. + /// The communication manager. public MultiTestRunFinalizationEventsHandler(ICommunicationManager communicationManager) { this.communicationManager = communicationManager; } - /// - /// The handle discovery message. - /// - /// Logging level. - /// Logging message. + /// public void HandleLogMessage(TestMessageLevel level, string message) { var testMessagePayload = new TestMessagePayload { MessageLevel = level, Message = message }; this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload); } + /// public void HandleMultiTestRunFinalizationComplete(ICollection attachments) { if (EqtTrace.IsInfoEnabled) @@ -53,6 +50,7 @@ public void HandleMultiTestRunFinalizationComplete(ICollection at this.communicationManager.SendMessage(MessageType.MultiTestRunFinalizationComplete, payload); } + /// public void HandleRawMessage(string rawMessage) { // No-Op diff --git a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IMultiTestRunFinalizationManager.cs b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IMultiTestRunFinalizationManager.cs index e91b1da0d3..078bc1349f 100644 --- a/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IMultiTestRunFinalizationManager.cs +++ b/src/Microsoft.TestPlatform.Common/Interfaces/Engine/IMultiTestRunFinalizationManager.cs @@ -17,16 +17,17 @@ internal interface IMultiTestRunFinalizationManager /// /// Finalizes multi test run and provides results through handler /// - /// Attachments - /// EventHandler for handling multi test run finalization events from Engine + /// Collection of attachments + /// EventHandler for handling multi test run finalization event /// Cancellation token Task FinalizeMultiTestRunAsync(ICollection attachments, IMultiTestRunFinalizationEventsHandler eventHandler, CancellationToken cancellationToken); /// - /// Finalizes multi test + /// Finalizes multi test run /// - /// Attachments + /// Collection of attachments /// Cancellation token + /// Collection of attachments. Task> FinalizeMultiTestRunAsync(ICollection attachments, CancellationToken cancellationToken); } } diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/Interfaces/ITestPlatformEventSource.cs b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/Interfaces/ITestPlatformEventSource.cs index a287b0cf6d..262803cf48 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/Interfaces/ITestPlatformEventSource.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/Interfaces/ITestPlatformEventSource.cs @@ -196,18 +196,18 @@ public interface ITestPlatformEventSource /// /// The multi test run finalization start. /// - /// - /// The number of attachements. + /// + /// The number of attachments. /// - void MultiTestRunFinalizationStart(long numberOfAttachements); + void MultiTestRunFinalizationStart(long numberOfAttachments); /// /// The multi test run finalization stop. /// - /// - /// The number of attachements. + /// + /// The number of attachments. /// - void MultiTestRunFinalizationStop(long numberOfAttachements); + void MultiTestRunFinalizationStop(long numberOfAttachments); /// /// Mark the start of translation layer multi test run finalization request. diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs index 7cda495578..cf7a4f5845 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs @@ -254,16 +254,16 @@ public void MultiTestRunFinalizationRequestStop() /// [Event(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId)] - public void MultiTestRunFinalizationStart(long numberOfAttachements) + public void MultiTestRunFinalizationStart(long numberOfAttachments) { - this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId, numberOfAttachements); + this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStartEventId, numberOfAttachments); } /// [Event(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId)] - public void MultiTestRunFinalizationStop(long numberOfAttachements) + public void MultiTestRunFinalizationStop(long numberOfAttachments) { - this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId, numberOfAttachements); + this.WriteEvent(TestPlatformInstrumentationEvents.MultiTestRunFinalizationStopEventId, numberOfAttachments); } /// diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs index 2eb388eeeb..23bb2d463b 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/MultiTestRunFinalization/MultiTestRunFinalizationManager.cs @@ -16,7 +16,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.MultiTestRunFinalization { /// - /// Orchestrates multi test run finalization operations for the engine communicating with the test host process. + /// Orchestrates multi test run finalization operations. /// public class MultiTestRunFinalizationManager : IMultiTestRunFinalizationManager { @@ -60,7 +60,7 @@ private async Task> InternalFinalizeMultiTestRunAsync( Task task = Task.Run(() => { - HandleAttachements(attachments, cancellationToken); + HandleAttachments(attachments, cancellationToken); }); var completedTask = await Task.WhenAny(task, taskCompletionSource.Task); @@ -92,7 +92,7 @@ private async Task> InternalFinalizeMultiTestRunAsync( } } - private void HandleAttachements(ICollection attachments, CancellationToken cancellationToken) + private void HandleAttachments(ICollection attachments, CancellationToken cancellationToken) { foreach (var dataCollectorAttachmentsHandler in dataCollectorAttachmentsHandlers) { @@ -107,8 +107,8 @@ private void HandleAttachements(ICollection attachments, Cancella attachments.Remove(attachment); } - ICollection processedAttachements = dataCollectorAttachmentsHandler.HandleDataCollectionAttachmentSets(new Collection(attachmentsToBeProcessed), cancellationToken); - foreach (var attachment in processedAttachements) + ICollection processedAttachments = dataCollectorAttachmentsHandler.HandleDataCollectionAttachmentSets(new Collection(attachmentsToBeProcessed), cancellationToken); + foreach (var attachment in processedAttachments) { attachments.Add(attachment); } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/MultiTestRunFinalizationPayload.cs b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/MultiTestRunFinalizationPayload.cs index 5066f0e3a9..13f7cfc229 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/MultiTestRunFinalizationPayload.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Client/Payloads/MultiTestRunFinalizationPayload.cs @@ -12,7 +12,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Client public class MultiTestRunFinalizationPayload { /// - /// Settings used for the discovery request. + /// Collection of attachments. /// [DataMember] public ICollection Attachments { get; set; } diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs index 224edbe0aa..45519affa7 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSender.cs @@ -113,9 +113,9 @@ internal interface ITranslationLayerRequestSender : IDisposable void CancelDiscovery(); /// - /// Provides back all attachements to TestPlatform for additional processing (for example merging) + /// Provides back all attachments to TestPlatform for additional processing (for example merging) /// - /// List of attachements + /// Collection of attachments /// Events handler /// Cancellation token Task FinalizeMultiTestRunAsync(ICollection attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSenderAsync.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSenderAsync.cs index babfee4518..0bf4ce0a82 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSenderAsync.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITranslationLayerRequestSenderAsync.cs @@ -79,9 +79,9 @@ internal interface ITranslationLayerRequestSenderAsync : IDisposable void OnProcessExited(); /// - /// Provides back all attachements to TestPlatform for additional processing (for example merging) + /// Provides back all attachments to TestPlatform for additional processing (for example merging) /// - /// List of attachements + /// Collection of attachments /// Events handler /// Cancellation token Task FinalizeMultiTestRunAsync(ICollection attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs index acc2ab836b..d9b86dac3a 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs @@ -121,9 +121,9 @@ public interface IVsTestConsoleWrapper void RunTestsWithCustomTestHost(IEnumerable testCases, string runSettings, TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher); /// - /// Provides back all attachements to TestPlatform for additional processing (for example merging) + /// Provides back all attachments to TestPlatform for additional processing (for example merging) /// - /// List of attachements + /// Collection of attachments /// EventHandler to receive session complete event /// Cancellation token Task FinalizeMultiTestRunAsync(ICollection attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs index d3b705150b..3e6cabe3b8 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs @@ -83,9 +83,9 @@ public interface IVsTestConsoleWrapperAsync Task RunTestsWithCustomTestHostAsync(IEnumerable testCases, string runSettings, TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher); /// - /// Provides back all attachements to TestPlatform for additional processing (for example merging) + /// Provides back all attachments to TestPlatform for additional processing (for example merging) /// - /// List of attachements + /// Collection of attachments /// EventHandler to receive session complete event /// Cancellation token Task FinalizeMultiTestRunAsync(ICollection attachments, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationCompleteEventsHandler, CancellationToken cancellationToken); diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs index b263203063..c32e28bfa5 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleRequestSender.cs @@ -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(message); diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs index 5ef58e6190..d38cc6cd0e 100644 --- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs @@ -312,13 +312,7 @@ public void RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLaunc } } - /// - /// Discover Tests given a list of sources, run settings. - /// - /// Discovery payload - /// EventHandler for discovered tests - /// Protocol related information - /// True, if successful + /// public void FinalizeMultiTestRun(MultiTestRunFinalizationPayload finalizationPayload, IMultiTestRunFinalizationEventsHandler finalizationEventsHandler) { EqtTrace.Info("TestRequestManager.FinalizeMultiTestRun: Multi test run finalization started."); @@ -392,9 +386,7 @@ public void AbortTestRun() this.currentTestRunRequest?.Abort(); } - /// - /// Cancel the multi test run finalization. - /// + /// public void CancelMultiTestRunFinalization() { EqtTrace.Info("TestRequestManager.CancelMultiTestRunFinalization: Sending cancel request."); diff --git a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Utility/ConverterTests.cs b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Utility/ConverterTests.cs index 8d1e341c9e..1734b9c15d 100644 --- a/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Utility/ConverterTests.cs +++ b/test/Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests/Utility/ConverterTests.cs @@ -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");