Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed May 7, 2020
1 parent df61f73 commit 7efc5c2
Show file tree
Hide file tree
Showing 13 changed files with 342 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ public static class MessageType
/// </summary>
public const string CustomTestHostLaunchCallback = "TestExecution.CustomTestHostLaunchCallback";

/// <summary>
/// Test session end
/// </summary>
public const string OnTestSessionEnd = "TestExecution.OnTestSessionEnd";

/// <summary>
/// Test session end callback
/// </summary>
public const string OnTestSessionEndCallback = "TestExecution.OnTestSessionEnd";

/// <summary>
/// Extensions Initialization
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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.CommunicationUtilities.ObjectModel
{
using System.Collections.Generic;

using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;

/// <summary>
/// The test run complete payload.
/// </summary>
public class TestSessionCompletePayload
{
/// <summary>
/// Gets or sets the attachments.
/// </summary>
public ICollection<AttachmentSet> Attachments { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,54 @@ public interface ITestPlatformEventSource
/// Mark the completion of Metrics Dispose.
/// </summary>
void MetricsDisposeStop();

/// <summary>
/// The session finalization request start.
/// </summary>
void SessionFinalizationRequestStart();

/// <summary>
/// The session finalization request stop.
/// </summary>
void SessionFinalizationRequestStop();

/// <summary>
/// The adapter session finalization start.
/// </summary>
/// <param name="numberOfAttachements">
/// The number of attachements.
/// </param>
void AdapterSessionFinalizationStart(long numberOfAttachements);

/// <summary>
/// The adapter session finalization stop.
/// </summary>
/// <param name="numberOfAttachements">
/// The number of attachements.
/// </param>
void AdapterSessionFinalizationStop(long numberOfAttachements);

/// <summary>
/// The session finalization start.
/// </summary>
void SessionFinalizationStart();

/// <summary>
/// The session finalization stop.
/// </summary>
/// <param name="numberOfAttachements">
/// The number of attachements.
/// </param>
void SessionFinalizationStop(long numberOfAttachements);

/// <summary>
/// Mark the start of translation layer session finalization request.
/// </summary>
void TranslationLayerSessionFinalizationStart();

/// <summary>
/// Mark the completion of translation layer session finalization request.
/// </summary>
void TranslationLayerSessionFinalizationStop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,61 @@ public void MetricsDisposeStop()
{
this.WriteEvent(TestPlatformInstrumentationEvents.MetricsDisposeStopEventId);
}

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.SessionFinalizationRequestStartEventId)]
public void SessionFinalizationRequestStart()
{
this.WriteEvent(TestPlatformInstrumentationEvents.SessionFinalizationRequestStartEventId);
}

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.SessionFinalizationRequestStopEventId)]
public void SessionFinalizationRequestStop()
{
this.WriteEvent(TestPlatformInstrumentationEvents.SessionFinalizationRequestStopEventId);
}

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

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

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.SessionFinalizationStartEventId)]
public void SessionFinalizationStart()
{
this.WriteEvent(TestPlatformInstrumentationEvents.SessionFinalizationStartEventId);
}

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

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.TranslationLayerSessionFinalizationStartEventId)]
public void TranslationLayerSessionFinalizationStart()
{
this.WriteEvent(TestPlatformInstrumentationEvents.TranslationLayerSessionFinalizationStartEventId);
}

/// <inheritdoc/>
[Event(TestPlatformInstrumentationEvents.TranslationLayerSessionFinalizationStopEventId)]
public void TranslationLayerSessionFinalizationStop()
{
this.WriteEvent(TestPlatformInstrumentationEvents.TranslationLayerSessionFinalizationStopEventId);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,45 @@ internal class TestPlatformInstrumentationEvents
/// Event fired on Metrics Dispose completes.
/// </summary>
public const int MetricsDisposeStopEventId = 0x39;

/// <summary>
/// The session finalization start event id.
/// </summary>
public const int SessionFinalizationStartEventId = 0x40;

/// <summary>
/// The session finalization stop event id.
/// </summary>
public const int SessionFinalizationStopEventId = 0x41;

/// <summary>
/// The session finalization request start event id.
/// </summary>
public const int SessionFinalizationRequestStartEventId = 0x42;

/// <summary>
/// The session finalization request stop event id.
/// </summary>
public const int SessionFinalizationRequestStopEventId = 0x43;

/// <summary>
/// The adapter session finalization start event id.
/// </summary>
public const int AdapterSessionFinalizationStartEventId = 0x44;

/// <summary>
/// The adapter session finalization stop event id.
/// </summary>
public const int AdapterSessionFinalizationStopEventId = 0x45;

/// <summary>
/// Events fired on session finalization start of translation layer.
/// </summary>
public const int TranslationLayerSessionFinalizationStartEventId = 0x46;

/// <summary>
/// Events fired on session finalization complete in translation layer.
/// </summary>
public const int TranslationLayerSessionFinalizationStopEventId = 0x47;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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.Client
{
using System.Collections.Generic;

/// <summary>
/// Interface contract for handling test session complete events
/// </summary>
public interface ITestSessionEventsHandler : ITestMessageEventHandler
{
/// <summary>
/// Dispatch SessionComplete event to listeners.
/// </summary>
/// <param name="attachments">Attachments reprocessed.</param>
void HandleTestSessionComplete(IEnumerable<AttachmentSet> attachments);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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.Client.Payloads
{
using System.Collections.Generic;
using System.Runtime.Serialization;

/// <summary>
/// Class used to define the OnTestSessionEndPayload sent by the Vstest.console translation layers into design mode
/// </summary>
public class OnTestSessionEndPayload
{
/// <summary>
/// Settings used for the discovery request.
/// </summary>
[DataMember]
public IEnumerable<AttachmentSet> Attachments { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,12 @@ internal interface ITranslationLayerRequestSender : IDisposable
/// Cancels the discovery of tests
/// </summary>
void CancelDiscovery();

/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="testSessionEventsHandler"></param>
void OnTestSessionEnd(IEnumerable<AttachmentSet> attachments, ITestSessionEventsHandler testSessionEventsHandler);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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.TestPlatform.VsTestConsole.TranslationLayer.Interfaces
{
using System.Collections.Generic;

using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;

/// <summary>
/// Controller for various test operations on the test runner.
/// </summary>
public interface IVsTestConsoleWrapper2 : IVsTestConsoleWrapper
{
/// <summary>
/// Provides back all attachements to TestPlatform for additional processing (for example merging)
/// </summary>
/// <param name="attachments">List of attachements</param>
/// <param name="testSessionEventsHandler">EventHandler to receive session complete event</param>
void OnTestSessionEnd(IEnumerable<AttachmentSet> attachments, ITestSessionEventsHandler testSessionEventsHandler);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7efc5c2

Please sign in to comment.