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

dotnet test should forward msbuild errors through standard error stream #2706

Closed
RikkiGibson opened this issue Jan 20, 2021 · 3 comments
Closed

Comments

@RikkiGibson
Copy link
Member

Description

Steps to reproduce

# in Powershell

# try to run tests on a nonexistent dll. we get error output, yay!
> dotnet test 'foo.dll' | out-null    
The test source file "C:\Users\rikki\src\roslyn\foo.dll" provided was not found.

# now introduce additional quotes in the filename, perhaps due to some mishap involving quoting and shell escaping.
# there is no output at all from this command :(
> dotnet test '''foo.dll''' | out-null

# the reason is that the msbuild errors are given through standard output
> dotnet test '''foo.dll'''
MSBUILD : error MSB1009: Project file does not exist.
Switch: 'foo.dll'

Expected behavior

When the dotnet test command has errors, relevant error messages should be given through the standard error stream, not standard output

Actual behavior

Sometimes dotnet test errors are given through the standard output stream.

Environment

Powershell 7 on Windows 10

@nohwnd
Copy link
Member

nohwnd commented Jun 23, 2021

@RikkiGibson we had some requests for this, but can't figure out how to make the output colored while keeping it compatible with msbuild. Imho msbuild should be more of implementation detail than driver for the way we do output.

Or is this only about msbuild errors, and not all errors?

@RikkiGibson
Copy link
Member Author

Or is this only about msbuild errors, and not all errors?

I only observed the bad behavior with msbuild errors. For non-msbuild error messages it appears that the errors are correctly written out to the stderr stream.

Is there more that needs to be done for this issue aside from ensuring that msbuild error output is captured separately and forwarded to the appropriate stream?

@Evangelink Evangelink added needs-triage This item should be discussed in the next triage meeting. triaged enhancement and removed needs-triage This item should be discussed in the next triage meeting. labels Jul 27, 2022
@nohwnd
Copy link
Member

nohwnd commented Jul 8, 2024

This should be solved by #2702 and all the subsequent terminal logger work that is shipped in net9.

@nohwnd nohwnd closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants