Update dotnet run tests for launch settings message on stderr#53905
Merged
MichaelSimons merged 6 commits intomainfrom Apr 16, 2026
Merged
Update dotnet run tests for launch settings message on stderr#53905MichaelSimons merged 6 commits intomainfrom
MichaelSimons merged 6 commits intomainfrom
Conversation
PR #53797 moved the 'Using launch settings from...' message from stdout to stderr but only updated dotnet test assertions. This updates the dotnet run test assertions to match: - StdErr.Should().BeEmpty() → StdErr.Should().Contain('Using launch settings from') for tests that use launch profiles - HaveStdOutContaining(UsingLaunchSettingsFromMessage) → HaveStdErrContaining - NotHaveStdOutContaining(UsingLaunchSettingsFromMessage) → NotHaveStdErrContaining Fixes ~11 test failures across Windows, Linux, and macOS CI legs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@Christian-Sidak, Can you please review? TIA |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates dotnet run tests to reflect the behavioral change from PR #53797 where the “Using launch settings from …” diagnostic is written to stderr instead of stdout, fixing CI test failures across platforms.
Changes:
- Adjusts assertions in run-related tests to expect the launch settings message on stderr.
- Replaces
Have/NotHaveStdOutContaining(UsingLaunchSettingsFromMessage)with the corresponding stderr variants for launch-profile scenarios. - Updates tests that previously asserted empty stderr to instead assert presence/absence of the launch settings diagnostic.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Run/RunCommandTests.cs | Updates stderr expectations for launch settings diagnostics in a dotnet run integration test. |
| test/dotnet.Tests/CommandTests/Run/GivenDotnetRunBuildsVbProj.cs | Moves launch settings message assertions to stderr for VB dotnet run tests. |
| test/dotnet.Tests/CommandTests/Run/GivenDotnetRunBuildsCsProj.cs | Moves launch settings message assertions to stderr for C# dotnet run tests and updates quiet/non-quiet scenarios. |
Member
|
Overlap with #53906. We should check tomorrow to see if there's anything either of us missed between the two. |
- CS ItDefaultsToTheFirstUsableLaunchProfile: restore StdErr.BeEmpty() since --verbosity quiet suppresses the launch settings message - VB ItDefaultsToTheFirstUsableLaunchProfile: fix path from Properties to My Project and assert message IS present on stderr Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
test/dotnet.Tests/CommandTests/Run/GivenDotnetRunBuildsCsProj.cs:424
- In
ItDefaultsToTheFirstUsableLaunchProfile,launchSettingsPathis still being computed but is no longer used after removing the assertion that referenced it. WithTreatWarningsAsErrorsenabled, this will fail the build; remove the unused local or use it in an assertion (e.g., against stderr) as intended.
cmd.Should().Pass()
.And.HaveStdOutContaining("First");
cmd.StdErr.Should().BeEmpty();
}
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace all hardcoded 'Using launch settings from' checks with string.Format(CliCommandStrings.UsingLaunchSettingsFromMessage, launchSettingsPath) for proper localization support and stronger assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
marcpopMSFT
approved these changes
Apr 16, 2026
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.
Fixes #53879
PR #53797 moved the 'Using launch settings from...' message from stdout to stderr but only updated dotnet test assertions. This updates the dotnet run test assertions to match:
Fixes ~11 test failures across Windows, Linux, and macOS CI legs.
These test failures weren't surfaced in #53797 because we had a test outage last week.