Skip to content

Commit

Permalink
Big renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed Jul 1, 2020
1 parent 5e51a03 commit 1267291
Show file tree
Hide file tree
Showing 54 changed files with 687 additions and 686 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.Client.MultiTestRunFinalization
namespace Microsoft.VisualStudio.TestPlatform.Client.TestRunAttachmentsProcessing
{
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
Expand All @@ -11,47 +11,48 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.MultiTestRunFinalization
using System.Collections.Generic;

/// <summary>
/// The multi test finalization events handler.
/// The test run attachments processing events handler.
/// </summary>
public class MultiTestRunFinalizationEventsHandler : IMultiTestRunFinalizationEventsHandler
///
public class TestRunAttachmentsProcessingEventsHandler : ITestRunAttachmentsProcessingEventsHandler
{
private readonly ICommunicationManager communicationManager;

/// <summary>
/// Initializes a new instance of the <see cref="MultiTestRunFinalizationEventsHandler"/> class.
/// Initializes a new instance of the <see cref="TestRunAttachmentsProcessingEventsHandler"/> class.
/// </summary>
/// <param name="communicationManager"> The communication manager. </param>
public MultiTestRunFinalizationEventsHandler(ICommunicationManager communicationManager)
public TestRunAttachmentsProcessingEventsHandler(ICommunicationManager communicationManager)
{
this.communicationManager = communicationManager;
}

/// <inheritdoc/>
public void HandleMultiTestRunFinalizationComplete(MultiTestRunFinalizationCompleteEventArgs finalizationCompleteEventArgs, IEnumerable<AttachmentSet> lastChunk)
public void HandleTestRunAttachmentsProcessingComplete(TestRunAttachmentsProcessingCompleteEventArgs attachmentsProcessingCompleteEventArgs, IEnumerable<AttachmentSet> lastChunk)
{
if (EqtTrace.IsInfoEnabled)
{
EqtTrace.Info("Multi test run finalization completed.");
EqtTrace.Info("Test run attachments processing completed.");
}

var payload = new MultiTestRunFinalizationCompletePayload()
var payload = new TestRunAttachmentsProcessingCompletePayload()
{
FinalizationCompleteEventArgs = finalizationCompleteEventArgs,
AttachmentsProcessingCompleteEventArgs = attachmentsProcessingCompleteEventArgs,
Attachments = lastChunk
};

this.communicationManager.SendMessage(MessageType.MultiTestRunFinalizationComplete, payload);
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingComplete, payload);
}

/// <inheritdoc/>
public void HandleMultiTestRunFinalizationProgress(MultiTestRunFinalizationProgressEventArgs finalizationProgressEventArgs)
public void HandleTestRunAttachmentsProcessingProgress(TestRunAttachmentsProcessingProgressEventArgs AttachmentsProcessingProgressEventArgs)
{
var payload = new MultiTestRunFinalizationProgressPayload()
var payload = new TestRunAttachmentsProcessingProgressPayload()
{
FinalizationProgressEventArgs = finalizationProgressEventArgs,
AttachmentsProcessingProgressEventArgs = AttachmentsProcessingProgressEventArgs,
};

this.communicationManager.SendMessage(MessageType.MultiTestRunFinalizationProgress, payload);
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingProgress, payload);
}

/// <inheritdoc/>
Expand Down
24 changes: 12 additions & 12 deletions src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Client.DesignMode
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestPlatform.Client.MultiTestRunFinalization;
using Microsoft.VisualStudio.TestPlatform.Client.TestRunAttachmentsProcessing;
using Microsoft.VisualStudio.TestPlatform.Client.RequestHelper;
using Microsoft.VisualStudio.TestPlatform.Common.Logging;
using Microsoft.VisualStudio.TestPlatform.Common.Utilities;
Expand Down Expand Up @@ -199,11 +199,11 @@ private void ProcessRequests(ITestRequestManager testRequestManager)
break;
}

case MessageType.MultiTestRunFinalizationStart:
case MessageType.TestRunAttachmentsProcessingStart:
{
var multiTestRunFinalizationPayload =
this.communicationManager.DeserializePayload<MultiTestRunFinalizationPayload>(message);
this.StartMultiTestRunFinalization(multiTestRunFinalizationPayload, testRequestManager);
var testRunAttachmentsProcessingPayload =
this.communicationManager.DeserializePayload<TestRunAttachmentsProcessingPayload>(message);
this.StartTestRunAttachmentsProcessing(testRunAttachmentsProcessingPayload, testRequestManager);
break;
}

Expand All @@ -225,9 +225,9 @@ private void ProcessRequests(ITestRequestManager testRequestManager)
break;
}

case MessageType.MultiTestRunFinalizationCancel:
case MessageType.TestRunAttachmentsProcessingCancel:
{
testRequestManager.CancelMultiTestRunFinalization();
testRequestManager.CancelTestRunAttachmentsProcessing();
break;
}

Expand Down Expand Up @@ -472,29 +472,29 @@ private void StartDiscovery(DiscoveryRequestPayload discoveryRequestPayload, ITe
});
}

private void StartMultiTestRunFinalization(MultiTestRunFinalizationPayload finalizationPayload, ITestRequestManager testRequestManager)
private void StartTestRunAttachmentsProcessing(TestRunAttachmentsProcessingPayload attachmentsProcessingPayload, ITestRequestManager testRequestManager)
{
Task.Run(
delegate
{
try
{
testRequestManager.FinalizeMultiTestRun(finalizationPayload, new MultiTestRunFinalizationEventsHandler(this.communicationManager), this.protocolConfig);
testRequestManager.ProcessTestRunAttachments(attachmentsProcessingPayload, new TestRunAttachmentsProcessingEventsHandler(this.communicationManager), this.protocolConfig);
}
catch (Exception ex)
{
EqtTrace.Error("DesignModeClient: Exception in StartMultiTestRunFinalization: " + ex);
EqtTrace.Error("DesignModeClient: Exception in StartTestRunAttachmentsProcessing: " + ex);

var testMessagePayload = new TestMessagePayload { MessageLevel = TestMessageLevel.Error, Message = ex.ToString() };
this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload);

var payload = new MultiTestRunFinalizationCompletePayload()
var payload = new TestRunAttachmentsProcessingCompletePayload()
{
Attachments = null
};

// Send run complete to translation layer
this.communicationManager.SendMessage(MessageType.MultiTestRunFinalizationComplete, payload);
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingComplete, payload);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public interface ITestRequestManager : IDisposable
void RunTests(TestRunRequestPayload testRunRequestPayLoad, ITestHostLauncher customTestHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig);

/// <summary>
/// Finalize multi test run
/// Processes test run attachments
/// </summary>
/// <param name="multiTestRunFinalizationPayload">Multi test run finalization payload</param>
/// <param name="multiTestRunFinalizationEventsHandler">Multi test run finalization events handler</param>
void FinalizeMultiTestRun(MultiTestRunFinalizationPayload multiTestRunFinalizationPayload, IMultiTestRunFinalizationEventsHandler multiTestRunFinalizationEventsHandler, ProtocolConfig protocolConfig);
/// <param name="testRunAttachmentsProcessingPayload">Test run attachments processing payload</param>
/// <param name="testRunAttachmentsProcessingEventsHandler">Test run attachments processing events handler</param>
void ProcessTestRunAttachments(TestRunAttachmentsProcessingPayload testRunAttachmentsProcessingPayload, ITestRunAttachmentsProcessingEventsHandler testRunAttachmentsProcessingEventsHandler, ProtocolConfig protocolConfig);

/// <summary>
/// Cancel the current TestRun request
Expand All @@ -67,8 +67,8 @@ public interface ITestRequestManager : IDisposable
void CancelDiscovery();

/// <summary>
/// Cancels the current multi test run finalization request
/// Cancels the current test run attachments processing request
/// </summary>
void CancelMultiTestRunFinalization();
void CancelTestRunAttachmentsProcessing();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine
{
/// <summary>
/// Orchestrates multi test run finalization operations.
/// Orchestrates test run attachments processing operations.
/// </summary>
internal interface IMultiTestRunFinalizationManager
internal interface ITestRunAttachmentsProcessingManager
{
/// <summary>
/// Finalizes multi test run and provides results through handler
/// Processes attachments and provides results through handler
/// </summary>
/// <param name="attachments">Collection of attachments</param>
/// <param name="eventHandler">EventHandler for handling multi test run finalization event</param>
/// <param name="eventHandler">EventHandler for handling test run attachments processing event</param>
/// <param name="cancellationToken">Cancellation token</param>
Task FinalizeMultiTestRunAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, IMultiTestRunFinalizationEventsHandler eventHandler, CancellationToken cancellationToken);
Task ProcessTestRunAttachmentsAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, ITestRunAttachmentsProcessingEventsHandler eventHandler, CancellationToken cancellationToken);

/// <summary>
/// Finalizes multi test run
/// Processes attachments
/// </summary>
/// <param name="attachments">Collection of attachments</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Collection of attachments.</returns>
Task<Collection<AttachmentSet>> FinalizeMultiTestRunAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, CancellationToken cancellationToken);
Task<Collection<AttachmentSet>> ProcessTestRunAttachmentsAsync(IRequestData requestData, IEnumerable<AttachmentSet> attachments, CancellationToken cancellationToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ public static class TelemetryDataConstants

public static string NumberOfAdapterUsedToDiscoverTests = "VS.TestDiscovery.AdaptersUsedCount";

// *********************Finalization****************************
public static string NumberOfAttachmentsSentForFinalization = "VS.TestFinalization.InitialAttachmentsCount";
// *********************Attachments Processing****************************
public static string NumberOfAttachmentsSentForProcessing = "VS.AttachmentsProcessing.InitialAttachmentsCount";

public static string NumberOfAttachmentsAfterFinalization = "VS.TestFinalization.FinalAttachmentsCount";
public static string NumberOfAttachmentsAfterProcessing = "VS.AttachmentsProcessing.FinalAttachmentsCount";

public static string TimeTakenInSecForFinalization = "VS.TestFinalization.TotalTimeTakenInSec";
public static string FinalizationState = "VS.TestFinalization.FinalizationState";
public static string TimeTakenInSecForAttachmentsProcessing = "VS.AttachmentsProcessing.TotalTimeTakenInSec";
public static string AttachmentsProcessingState = "VS.AttachmentsProcessing.State";

// **************Events Name **********************************
public static string TestDiscoveryCompleteEvent = "vs/testplatform/testdiscoverysession";

public static string TestExecutionCompleteEvent = "vs/testplatform/testrunsession";

public static string TestFinalizationCompleteEvent = "vs/testplatform/testfinalizationsession";
public static string TestAttachmentsProcessingCompleteEvent = "vs/testplatform/testattachmentsprocessingsession";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,24 @@ public static class MessageType
public const string CustomTestHostLaunchCallback = "TestExecution.CustomTestHostLaunchCallback";

/// <summary>
/// Multi test run finalization
/// Test run attachments processing
/// </summary>
public const string MultiTestRunFinalizationStart = "MultiTestRunFinalization.Start";
public const string TestRunAttachmentsProcessingStart = "TestRunAttachmentsProcessing.Start";

/// <summary>
/// Multi test run finalization callback
/// Test run attachments processing callback
/// </summary>
public const string MultiTestRunFinalizationComplete = "MultiTestRunFinalization.Complete";
public const string TestRunAttachmentsProcessingComplete = "TestRunAttachmentsProcessing.Complete";

/// <summary>
/// Multi test run finalization progress
/// Test run attachments processing progress
/// </summary>
public const string MultiTestRunFinalizationProgress = "MultiTestRunFinalization.Progress";
public const string TestRunAttachmentsProcessingProgress = "TestRunAttachmentsProcessing.Progress";

/// <summary>
/// Cancel multi test run finalization
/// Cancel test run attachments processing
/// </summary>
public const string MultiTestRunFinalizationCancel = "MultiTestRunFinalization.Cancel";
public const string TestRunAttachmentsProcessingCancel = "TestRunAttachmentsProcessing.Cancel";

/// <summary>
/// Extensions Initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;

/// <summary>
/// Multi test run finalization complete payload.
/// Test run attachments processing complete payload.
/// </summary>
public class MultiTestRunFinalizationCompletePayload
public class TestRunAttachmentsProcessingCompletePayload
{
/// <summary>
/// Gets or sets the multi test run finalization complete args.
/// Gets or sets the test run attachments processing complete args.
/// </summary>
public MultiTestRunFinalizationCompleteEventArgs FinalizationCompleteEventArgs { get; set; }
public TestRunAttachmentsProcessingCompleteEventArgs AttachmentsProcessingCompleteEventArgs { get; set; }

/// <summary>
/// Gets or sets the attachments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;

/// <summary>
/// Multi test run finalization complete payload.
/// Test run attachments processing complete payload.
/// </summary>
public class MultiTestRunFinalizationProgressPayload
public class TestRunAttachmentsProcessingProgressPayload
{
/// <summary>
/// Gets or sets the multi test run finalization complete args.
/// Gets or sets the test run attachments processing complete args.
/// </summary>
public MultiTestRunFinalizationProgressEventArgs FinalizationProgressEventArgs { get; set; }
public TestRunAttachmentsProcessingProgressEventArgs AttachmentsProcessingProgressEventArgs { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,39 +184,39 @@ public interface ITestPlatformEventSource
void MetricsDisposeStop();

/// <summary>
/// The multi test run finalization request start.
/// The test run attachments processing request start.
/// </summary>
void MultiTestRunFinalizationRequestStart();
void TestRunAttachmentsProcessingRequestStart();

/// <summary>
/// The multi test run finalization request stop.
/// The test run attachments processing request stop.
/// </summary>
void MultiTestRunFinalizationRequestStop();
void TestRunAttachmentsProcessingRequestStop();

/// <summary>
/// The multi test run finalization start.
/// The test run attachments processing start.
/// </summary>
/// <param name="numberOfAttachments">
/// The number of attachments.
/// </param>
void MultiTestRunFinalizationStart(long numberOfAttachments);
void TestRunAttachmentsProcessingStart(long numberOfAttachments);

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

/// <summary>
/// Mark the start of translation layer multi test run finalization request.
/// Mark the start of translation layer test run attachments processing request.
/// </summary>
void TranslationLayerMultiTestRunFinalizationStart();
void TranslationLayerTestRunAttachmentsProcessingStart();

/// <summary>
/// Mark the completion of translation layer multi test run finalization request.
/// Mark the completion of translation layer test run attachments processing request.
/// </summary>
void TranslationLayerMultiTestRunFinalizationStop();
void TranslationLayerTestRunAttachmentsProcessingStop();
}
}
Loading

0 comments on commit 1267291

Please sign in to comment.