Skip to content

Include verbose output in RunFileTests#53884

Open
jjonescz wants to merge 8 commits intodotnet:mainfrom
jjonescz:7289-VerboseToStdErr
Open

Include verbose output in RunFileTests#53884
jjonescz wants to merge 8 commits intodotnet:mainfrom
jjonescz:7289-VerboseToStdErr

Conversation

@jjonescz
Copy link
Copy Markdown
Member

@jjonescz jjonescz commented Apr 15, 2026

Should help with investigating these flaky failures: #53869 (but also other failures in these tests the future).

@jjonescz jjonescz changed the title Make verbose output go to stderr Make verbose output go to stderr in RunFileTests Apr 16, 2026
@jjonescz jjonescz changed the title Make verbose output go to stderr in RunFileTests Include verbose output in RunFileTests Apr 16, 2026
@jjonescz jjonescz added Test Debt Area-run-file Items related to the "dotnet run <file>" effort labels Apr 16, 2026
@jjonescz jjonescz marked this pull request as ready for review April 16, 2026 12:17
@jjonescz jjonescz requested review from a team and Copilot April 16, 2026 12:17
Copy link
Copy Markdown
Contributor

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

Updates dotnet run file-mode test execution to emit verbose diagnostics (without polluting stdout assertions) and adjusts CLI verbose plumbing to support sending verbose output to stderr.

Changes:

  • Enable verbose logging for RunFileTestBase’s dotnet run invocations and route verbose output to stderr.
  • Add a new logging context env var to control whether verbose output goes to stderr.
  • Route an early “Telemetry is …” verbose message through Reporter.Verbose instead of Console.WriteLine.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/dotnet.Tests/CommandTests/Run/RunFileTestBase.cs Sets verbose-related env vars for dotnet run in file-mode tests.
src/Cli/Microsoft.DotNet.Cli.Utils/CommandLoggingContext.cs Introduces DOTNET_CLI_CONTEXT_VERBOSE_TO_STDERR and exposes IsVerboseToStdErr.
src/Cli/Microsoft.DotNet.Cli.Utils/Reporter.cs Routes Reporter.Verbose to stderr when configured.
src/Cli/dotnet/Program.cs Emits telemetry state via Reporter.Verbose when verbosity is enabled.

Comment thread src/Cli/Microsoft.DotNet.Cli.Utils/CommandLoggingContext.cs
Comment thread src/Cli/Microsoft.DotNet.Cli.Utils/Reporter.cs Outdated
Comment thread test/dotnet.Tests/CommandTests/Run/RunFileTestBase.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-run-file Items related to the "dotnet run <file>" effort Test Debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants