Fix trx in case of exit code != 0 #3887
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 introduces changes to the
TrxReportGenerator
and related classes to include the process exit code in the TRX report generation. The most important changes include adding a new dependency forITestApplicationProcessExitCode
, updating theTrxReportEngine
to handle the exit code, and modifying the result summary to reflect the exit code.Changes to
TrxReportGenerator
and Dependencies:src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxDataConsumer.cs
: AddedITestApplicationProcessExitCode
as a dependency and updated the constructor andOnTestSessionFinishingAsync
method to use it. [1] [2] [3] [4]Changes to
TrxReportEngine
:src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxReportEngine.cs
: Added_exitCode
field and updated the constructor and methods to handle the exit code, including modifying theGenerateReportAsync
andAddResultSummaryAsync
methods to use the exit code. [1] [2] [3] [4] [5] [6]Changes to
TrxProcessLifetimeHandler
:src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxProcessLifetimeHandler.cs
: Updated methods to include the exit code when publishing messages. [1] [2]Additional Changes:
src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxReportExtensions.cs
: Updated to includeITestApplicationProcessExitCode
in the service provider.src/Platform/Microsoft.Testing.Platform/Hosts/ConsoleTestHost.cs
: Changed to use synchronousGetProcessExitCode
method.src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
: Added and set upTestApplicationResultProxy
to manage the exit code service. [1] [2]Localization Updates:
fixes #3768