On .NET Core 8 with xUnit (Abstractions version 2.0) when we write test output to the TestOutputHelper
, every line that's written to the output - see screenshot (1) - counts as a "Warning", see screenshot (2), in the Visual Studio 2022 test explorer.
Is this an oversight from Microsoft to not funnel this into a "Log", "Information" or other non-warning, non-error counter, or are we doing something wrong? There is nothing like a "log level" at play, we are simply calling the void WriteLine(string message)
method on the test output helper.
Another sample, here it can be seen that only the first message is actually a warning:
Versions:
This is my xunit.runner.json content
{
"diagnosticMessages": true,
"shadowCopy": false
}
I couldn't reproduce when my test project didn't have a xunit.runner.json
file.
After adding one the issue appeared.
As a solution, see if you really need that xunit.runner.json
file an remove it.
Otherwise, disable diagnostic messages:
{
"diagnosticMessages": false,
"shadowCopy": false
}