Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.3-beta1.24423.1</MicrosoftCodeAnalysisAnalyzerTestingVersion>
</PropertyGroup>
<ItemGroup Label="Analyzers">
<PackageVersion Include="EasyNamedPipes.SourceGenerator" Version="1.0.0-beta.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(MicrosoftCodeAnalysisBannedApiAnalyzersVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
Expand All @@ -40,10 +41,8 @@
<ItemGroup Label="Product dependencies">
<!-- If this gets updated, please revise if the explicit dependency on System.Diagnostics.DiagnosticSource is still needed -->
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.23.0" />

<!-- This comes transitvely via Microsoft.ApplicationInsights, but we want to upgrade it because 5.0.0 is not maintained -->
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" />

<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
Expand Down Expand Up @@ -94,4 +93,4 @@
<ItemGroup Label="Declared by MSTest.Sdk but not used directly">
<PackageVersion Include="Microsoft.Playwright.MSTest.v4" Version="$(MicrosoftPlaywrightVersion)" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
namedPipeBase.RegisterSerializer(new VoidResponseSerializer(), typeof(VoidResponse));
namedPipeBase.RegisterSerializer(new TestHostProcessExitRequestSerializer(), typeof(TestHostProcessExitRequest));
namedPipeBase.RegisterSerializer(new TestHostProcessPIDRequestSerializer(), typeof(TestHostProcessPIDRequest));
namedPipeBase.RegisterSerializer(new CommandLineOptionMessagesSerializer(), typeof(CommandLineOptionMessages));
namedPipeBase.RegisterSerializer(new DiscoveredTestMessagesSerializer(), typeof(DiscoveredTestMessages));
namedPipeBase.RegisterSerializer(new TestResultMessagesSerializer(), typeof(TestResultMessages));
namedPipeBase.RegisterSerializer(new FileArtifactMessagesSerializer(), typeof(FileArtifactMessages));
namedPipeBase.RegisterSerializer(new TestSessionEventSerializer(), typeof(TestSessionEvent));
namedPipeBase.RegisterSerializer(new HandshakeMessageSerializer(), typeof(HandshakeMessage));
namedPipeBase.RegisterSerializer(CommandLineOptionMessagesSerializer.Instance, typeof(CommandLineOptionMessages));

Check failure on line 32 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L32

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(32,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'CommandLineOptionMessagesSerializer' does not exist in the current context

Check failure on line 32 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L32

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(32,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'CommandLineOptionMessagesSerializer' does not exist in the current context

Check failure on line 32 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L32

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(32,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'CommandLineOptionMessagesSerializer' does not exist in the current context

Check failure on line 32 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L32

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(32,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'CommandLineOptionMessagesSerializer' does not exist in the current context

Check failure on line 32 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L32

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(32,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'CommandLineOptionMessagesSerializer' does not exist in the current context
namedPipeBase.RegisterSerializer(DiscoveredTestMessagesSerializer.Instance, typeof(DiscoveredTestMessages));

Check failure on line 33 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L33

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(33,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'DiscoveredTestMessagesSerializer' does not exist in the current context

Check failure on line 33 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L33

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(33,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'DiscoveredTestMessagesSerializer' does not exist in the current context

Check failure on line 33 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L33

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(33,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'DiscoveredTestMessagesSerializer' does not exist in the current context

Check failure on line 33 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L33

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(33,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'DiscoveredTestMessagesSerializer' does not exist in the current context

Check failure on line 33 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L33

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(33,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'DiscoveredTestMessagesSerializer' does not exist in the current context
namedPipeBase.RegisterSerializer(TestResultMessagesSerializer.Instance, typeof(TestResultMessages));

Check failure on line 34 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L34

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(34,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestResultMessagesSerializer' does not exist in the current context

Check failure on line 34 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L34

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(34,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestResultMessagesSerializer' does not exist in the current context

Check failure on line 34 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L34

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(34,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestResultMessagesSerializer' does not exist in the current context

Check failure on line 34 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L34

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(34,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestResultMessagesSerializer' does not exist in the current context

Check failure on line 34 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L34

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(34,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestResultMessagesSerializer' does not exist in the current context
namedPipeBase.RegisterSerializer(FileArtifactMessagesSerializer.Instance, typeof(FileArtifactMessages));

Check failure on line 35 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L35

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(35,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'FileArtifactMessagesSerializer' does not exist in the current context

Check failure on line 35 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L35

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(35,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'FileArtifactMessagesSerializer' does not exist in the current context

Check failure on line 35 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L35

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(35,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'FileArtifactMessagesSerializer' does not exist in the current context

Check failure on line 35 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L35

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(35,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'FileArtifactMessagesSerializer' does not exist in the current context

Check failure on line 35 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L35

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(35,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'FileArtifactMessagesSerializer' does not exist in the current context
namedPipeBase.RegisterSerializer(TestSessionEventSerializer.Instance, typeof(TestSessionEvent));

Check failure on line 36 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Release)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L36

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(36,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestSessionEventSerializer' does not exist in the current context

Check failure on line 36 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Linux Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L36

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(36,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestSessionEventSerializer' does not exist in the current context

Check failure on line 36 in src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build MacOS Debug)

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs#L36

src/Platform/Microsoft.Testing.Platform/IPC/Serializers/RegisterSerializers.cs(36,42): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'TestSessionEventSerializer' does not exist in the current context
namedPipeBase.RegisterSerializer(HandshakeMessageSerializer.Instance, typeof(HandshakeMessage));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ This package provides the core platform and the .NET implementation of the proto
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyNamedPipes.SourceGenerator" />
<PackageReference Include="Polyfill" PrivateAssets="all" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using EasyNamedPipes;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record CommandLineOptionMessage(string? Name, string? Description, bool? IsHidden, bool? IsBuiltIn);
internal sealed record CommandLineOptionMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing the attribute here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what's the right policy. If I look at the old serializer only the outer message was marked, the inner message is only an object of the outer.

[property: PipePropertyId(1)] string? Name,
[property: PipePropertyId(2)] string? Description,
[property: PipePropertyId(3)] bool? IsHidden,
[property: PipePropertyId(4)] bool? IsBuiltIn);

internal sealed record CommandLineOptionMessages(string? ModulePath, CommandLineOptionMessage[]? CommandLineOptionMessageList) : IRequest;
[PipeSerializableMessage("DotNetTestProtocol", 3)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we extract the message ID constants to a static class?

internal sealed record CommandLineOptionMessages(
[property: PipePropertyId(1)] string? ModulePath,
[property: PipePropertyId(2)] CommandLineOptionMessage[]? CommandLineOptionMessageList) : IRequest;
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using EasyNamedPipes;

using Microsoft.Testing.Platform.Extensions.Messages;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record DiscoveredTestMessage(string? Uid, string? DisplayName, string? FilePath, int? LineNumber, string? Namespace, string? TypeName, string? MethodName, string[]? ParameterTypeFullNames, TestMetadataProperty[] Traits);
internal sealed record DiscoveredTestMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing the attribute here?

[property: PipePropertyId(1)] string? Uid,
[property: PipePropertyId(2)] string? DisplayName,
[property: PipePropertyId(3)] string? FilePath,
[property: PipePropertyId(4)] int? LineNumber,
[property: PipePropertyId(5)] string? Namespace,
[property: PipePropertyId(6)] string? TypeName,
[property: PipePropertyId(7)] string? MethodName,
[property: PipePropertyId(8)] string[]? ParameterTypeFullNames,
[property: PipePropertyId(9)] TestMetadataProperty[] Traits);

internal sealed record DiscoveredTestMessages(string? ExecutionId, string? InstanceId, DiscoveredTestMessage[] DiscoveredMessages) : IRequest;
[PipeSerializableMessage("DotNetTestProtocol", 5)]
internal sealed record DiscoveredTestMessages(
[property: PipePropertyId(1)] string? ExecutionId,
[property: PipePropertyId(2)] string? InstanceId,
[property: PipePropertyId(3)] DiscoveredTestMessage[] DiscoveredMessages)
: IRequest;
Original file line number Diff line number Diff line change
@@ -1,8 +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.

using EasyNamedPipes;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record FileArtifactMessage(string? FullPath, string? DisplayName, string? Description, string? TestUid, string? TestDisplayName, string? SessionUid);
internal sealed record FileArtifactMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing the attribute here?

[property: PipePropertyId(1)] string? FullPath,
[property: PipePropertyId(2)] string? DisplayName,
[property: PipePropertyId(3)] string? Description,
[property: PipePropertyId(4)] string? TestUid,
[property: PipePropertyId(5)] string? TestDisplayName,
[property: PipePropertyId(6)] string? SessionUid);

internal sealed record FileArtifactMessages(string? ExecutionId, string? InstanceId, FileArtifactMessage[] FileArtifacts) : IRequest;
[PipeSerializableMessage("DotNetTestProtocol", 7)]
internal sealed record FileArtifactMessages(
[property: PipePropertyId(1)] string? ExecutionId,
[property: PipePropertyId(2)] string? InstanceId,
[property: PipePropertyId(3)] FileArtifactMessage[] FileArtifacts)
: IRequest;
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using EasyNamedPipes;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record HandshakeMessage(Dictionary<byte, string>? Properties) : IRequest, IResponse;
[PipeSerializableMessage("DotNetTestProtocol", 9)]
internal sealed record HandshakeMessage(
[property: PipePropertyId(1)] Dictionary<byte, string>? Properties)
: IRequest, IResponse;
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using EasyNamedPipes;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record SuccessfulTestResultMessage(string? Uid, string? DisplayName, byte? State, long? Duration, string? Reason, string? StandardOutput, string? ErrorOutput, string? SessionUid);
internal sealed record SuccessfulTestResultMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

[property: PipePropertyId(1)] string? Uid,
[property: PipePropertyId(2)] string? DisplayName,
[property: PipePropertyId(3)] byte? State,
[property: PipePropertyId(4)] long? Duration,
[property: PipePropertyId(5)] string? Reason,
[property: PipePropertyId(6)] string? StandardOutput,
[property: PipePropertyId(7)] string? ErrorOutput,
[property: PipePropertyId(8)] string? SessionUid);

internal sealed record FailedTestResultMessage(string? Uid, string? DisplayName, byte? State, long? Duration, string? Reason, ExceptionMessage[]? Exceptions, string? StandardOutput, string? ErrorOutput, string? SessionUid);
internal sealed record FailedTestResultMessage(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

[property: PipePropertyId(1)] string? Uid,
[property: PipePropertyId(2)] string? DisplayName,
[property: PipePropertyId(3)] byte? State,
[property: PipePropertyId(4)] long? Duration,
[property: PipePropertyId(5)] string? Reason,
[property: PipePropertyId(6)] ExceptionMessage[]? Exceptions,
[property: PipePropertyId(7)] string? StandardOutput,
[property: PipePropertyId(8)] string? ErrorOutput,
[property: PipePropertyId(9)] string? SessionUid);

internal sealed record ExceptionMessage(string? ErrorMessage, string? ErrorType, string? StackTrace);
internal sealed record ExceptionMessage(
[property: PipePropertyId(1)] string? ErrorMessage,
[property: PipePropertyId(2)] string? ErrorType,
[property: PipePropertyId(3)] string? StackTrace);

internal sealed record TestResultMessages(string? ExecutionId, string? InstanceId, SuccessfulTestResultMessage[] SuccessfulTestMessages, FailedTestResultMessage[] FailedTestMessages) : IRequest;
[PipeSerializableMessage("DotNetTestProtocol", 6)]
internal sealed record TestResultMessages(
[property: PipePropertyId(1)] string? ExecutionId,
[property: PipePropertyId(2)] string? InstanceId,
[property: PipePropertyId(3)] SuccessfulTestResultMessage[] SuccessfulTestMessages,
[property: PipePropertyId(4)] FailedTestResultMessage[] FailedTestMessages)
: IRequest;
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using EasyNamedPipes;

namespace Microsoft.Testing.Platform.IPC.Models;

internal sealed record TestSessionEvent(byte? SessionType, string? SessionUid, string? ExecutionId) : IRequest;
[PipeSerializableMessage("DotNetTestProtocol", 8)]
internal sealed record TestSessionEvent(
[property: PipePropertyId(1)] byte? SessionType,
[property: PipePropertyId(2)] string? SessionUid,
[property: PipePropertyId(3)] string? ExecutionId)
: IRequest;
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ internal static class TestHostProcessPIDRequestFieldsId
public const int MessagesSerializerId = 2;
}

internal static class CommandLineOptionMessagesFieldsId
{
public const int MessagesSerializerId = 3;

public const ushort ModulePath = 1;
public const ushort CommandLineOptionMessageList = 2;
}

internal static class CommandLineOptionMessageFieldsId
{
public const ushort Name = 1;
Expand All @@ -38,15 +30,6 @@ internal static class CommandLineOptionMessageFieldsId
public const ushort IsBuiltIn = 4;
}

internal static class DiscoveredTestMessagesFieldsId
{
public const int MessagesSerializerId = 5;

public const ushort ExecutionId = 1;
public const ushort InstanceId = 2;
public const ushort DiscoveredTestMessageList = 3;
}

internal static class DiscoveredTestMessageFieldsId
{
public const ushort Uid = 1;
Expand All @@ -59,84 +42,3 @@ internal static class DiscoveredTestMessageFieldsId
public const ushort Traits = 8;
public const ushort ParameterTypeFullNames = 9;
}

internal static class TraitMessageFieldsId
{
public const ushort Key = 1;
public const ushort Value = 2;
}

internal static class TestResultMessagesFieldsId
{
public const int MessagesSerializerId = 6;

public const ushort ExecutionId = 1;
public const ushort InstanceId = 2;
public const ushort SuccessfulTestMessageList = 3;
public const ushort FailedTestMessageList = 4;
}

internal static class SuccessfulTestResultMessageFieldsId
{
public const ushort Uid = 1;
public const ushort DisplayName = 2;
public const ushort State = 3;
public const ushort Duration = 4;
public const ushort Reason = 5;
public const ushort StandardOutput = 6;
public const ushort ErrorOutput = 7;
public const ushort SessionUid = 8;
}

internal static class FailedTestResultMessageFieldsId
{
public const ushort Uid = 1;
public const ushort DisplayName = 2;
public const ushort State = 3;
public const ushort Duration = 4;
public const ushort Reason = 5;
public const ushort ExceptionMessageList = 6;
public const ushort StandardOutput = 7;
public const ushort ErrorOutput = 8;
public const ushort SessionUid = 9;
}

internal static class ExceptionMessageFieldsId
{
public const ushort ErrorMessage = 1;
public const ushort ErrorType = 2;
public const ushort StackTrace = 3;
}

internal static class FileArtifactMessagesFieldsId
{
public const int MessagesSerializerId = 7;

public const ushort ExecutionId = 1;
public const ushort InstanceId = 2;
public const ushort FileArtifactMessageList = 3;
}

internal static class FileArtifactMessageFieldsId
{
public const ushort FullPath = 1;
public const ushort DisplayName = 2;
public const ushort Description = 3;
public const ushort TestUid = 4;
public const ushort TestDisplayName = 5;
public const ushort SessionUid = 6;
}

internal static class TestSessionEventFieldsId
{
public const int MessagesSerializerId = 8;

public const ushort SessionType = 1;
public const ushort SessionUid = 2;
public const ushort ExecutionId = 3;
}

internal static class HandshakeMessageFieldsId
{
public const int MessagesSerializerId = 9;
}
Loading
Loading