Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: dotnet test failure in CliTests.Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn #1458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ogaken-1
Copy link

Problem

The test CliTests.Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn was consistently failing when executed via the dotnet test command.

This issue appears to have been caused by CliWrap, which initializes ProcessStartInfo with RedirectStandardInput = true by default. This behavior interfered with the test, as it relies on Console.IsInputRedirected being false.

Solution

This patch updates the test to use ProcessStartInfo directly instead of relying on CliWrap. This ensures that RedirectStandardInput is explicitly set to false.

…irectoryOrFile_And_Not_Piping_StdIn`

Problem:

The test `CliTests.Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn`
was consistently failing when executed via the `dotnet test` command.

This issue appears to have been caused by CliWrap, which initializes
`ProcessStartInfo` with `RedirectStandardInput = true` by default.
This behavior interfered with the test, as it relies on
`Console.IsInputRedirected` being `false`.

Solution:

This patch updates the test to use `ProcessStartInfo` directly
instead of relying on CliWrap. This ensures that `RedirectStandardInput`
is explicitly set to `false`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant