Skip to content

Conversation

elinor-fung
Copy link
Member

The assertion only ended up printing stderr, but it would be useful to have all the information about the command that was run (the exit code, stdout). Without it, we have no insight into issues like #118170, especially since it does not seem to repro easily (first time we've seen it, hasn't been hit again).

Resolves #118170 - while this wouldn't actually fix whatever happened there, it will give us insight into any similar issues that happen again.

cc @dotnet/appmodel @AaronRobinsonMSFT

@Copilot Copilot AI review requested due to automatic review settings August 14, 2025 00:29
@elinor-fung elinor-fung added test-enhancement Improvements of test source code area-Host labels Aug 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the test infrastructure for host tests by improving the diagnostics information provided when StdErr assertions fail. Instead of only showing stderr output, it now provides comprehensive command execution details including file name, arguments, environment variables, exit code, and both stdout and stderr.

  • Moves GetDiagnosticsInfo() method from CommandResultAssertions to CommandResult class for better encapsulation
  • Updates assertion error messages to use the enhanced diagnostics information
  • Filters environment variables to show DOTNET_ prefixed variables instead of just DOTNET_ROOT

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/installer/tests/TestUtils/CommandResult.cs Adds GetDiagnosticsInfo() method to provide comprehensive command execution details
src/installer/tests/TestUtils/Assertions/CommandResultExtensions.cs Updates StdErr assertion error message to use new diagnostics info
src/installer/tests/TestUtils/Assertions/CommandResultAssertions.cs Removes GetDiagnosticsInfo() method and delegates to CommandResult implementation

Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@elinor-fung elinor-fung merged commit 55b6d64 into dotnet:main Aug 15, 2025
73 checks passed
@elinor-fung elinor-fung deleted the issue118170 branch August 15, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Host test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PortableComponentOnSelfContainedAppRidAssetResolution.RidSpecificAssembly_CurrentRid test failure
2 participants