Add extra properties for test results in dotnet test #3932
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant updates to the test result handling and serialization logic in the
Microsoft.Testing.Platform
project. The changes enhance the detail and accuracy of test result messages, adding new fields and improving the serialization process.Enhancements to Test Result Handling:
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
: AddedStandardErrorProperty
andStandardOutputProperty
toTestNode
properties for better error and output tracking.src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/DotnetTestDataConsumer.cs
: RefactoredGetTestNodeDetails
to return aTestNodeDetails
record, encapsulating state, duration, reason, error message, stack trace, standard output, and standard error. UpdatedConsumeAsync
method to utilize this new structure. [1] [2] [3] [4] [5] [6]Serialization Improvements:
src/Platform/Microsoft.Testing.Platform/IPC/Serializers/BaseSerializer.cs
: Added a newWriteField
method to handlelong?
values and updated theWriteAtPosition
method to supportlong
type. [1] [2]src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/TestResultMessages.cs
: ModifiedSuccessfulTestResultMessage
andFailedTestResultMessage
records to includeDuration
,StandardOutput
, andErrorOutput
fields.src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/ObjectFieldIds.cs
: Updated field IDs to accommodate new fields in test result messages.src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Serializers/TestResultMessagesSerializer.cs
: Enhanced the serialization format to include new fields (Duration
,StandardOutput
,StandardError
) for both successful and failed test messages. Updated the payload reading logic to handle these new fields.