Add extra properties for test results in dotnet test#3932
Merged
Conversation
…results-in-dotnet-test
nohwnd
reviewed
Oct 11, 2024
src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ObjectModelConverters.cs
Show resolved
Hide resolved
nohwnd
reviewed
Oct 11, 2024
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/ObjectFieldIds.cs
Show resolved
Hide resolved
nohwnd
approved these changes
Oct 11, 2024
MarcoRossignoli
approved these changes
Oct 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Platformproject. 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: AddedStandardErrorPropertyandStandardOutputPropertytoTestNodeproperties for better error and output tracking.src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/DotnetTestDataConsumer.cs: RefactoredGetTestNodeDetailsto return aTestNodeDetailsrecord, encapsulating state, duration, reason, error message, stack trace, standard output, and standard error. UpdatedConsumeAsyncmethod to utilize this new structure. [1] [2] [3] [4] [5] [6]Serialization Improvements:
src/Platform/Microsoft.Testing.Platform/IPC/Serializers/BaseSerializer.cs: Added a newWriteFieldmethod to handlelong?values and updated theWriteAtPositionmethod to supportlongtype. [1] [2]src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/TestResultMessages.cs: ModifiedSuccessfulTestResultMessageandFailedTestResultMessagerecords to includeDuration,StandardOutput, andErrorOutputfields.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.