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

Improve output of dotnet test #3842

Open
Socolin opened this issue Jul 5, 2022 · 5 comments
Open

Improve output of dotnet test #3842

Socolin opened this issue Jul 5, 2022 · 5 comments

Comments

@Socolin
Copy link

Socolin commented Jul 5, 2022

Hello,

When running dotnet test there are a lots of output and the console output is kind of useless du to the noise.

Would it be possible to improve the output to get something similar with jest for example:

  • One line for each passed test (tree view when there are multiple assembly)
  • Write at the end all the failed test and their output
  • Total success / failed test at the very end

image

@Anton-V-K
Copy link

Running C# tests is also possible with vstest.console.exe.
Have you tried it?
It produces the output similar to the one you're refferring to on the picture:
image

@Socolin
Copy link
Author

Socolin commented Nov 18, 2022

The request here is to improve the default output from dotnet test, nunit console or vstest.console.exe might have better output, but I don't want to add in my build pipeline a linux and windows binary that need to be upgraded manually later.

dotnet test is simple and I think it should get readable output in scenario where lots of tests are running.

And when runnning test locally I can just Rider test runner

@Evangelink Evangelink added needs-triage This item should be discussed in the next triage meeting. enhancement exp: logger and removed needs-triage This item should be discussed in the next triage meeting. labels Nov 29, 2022
@MFDeAngelo
Copy link

I'd like to add that I would really appreciate this feature as well. Honestly, it doesn't even need to be that big of a change. If we could avoid outputting the entire test results on a single line, that would be a huge advantage. A simple change such as changing Passed! - Failed: 0, Passed: 7, Skipped: 0, Total: 7, Duration: 6 s - IntegrationTests.dll (net6.0) to

Passed!  
Failed:     0, 
Passed:     7,
Skipped:     0, 
Total:     7, 
Duration: 6 s 
IntegrationTests.dll (net6.0)

would be an enormous improvement.

@nohwnd
Copy link
Member

nohwnd commented Jan 3, 2024

dotnet test is internally using vstest.console to run tests, and you can change to the same output by setting the console logger to detailed mode dotnet test --logger:"console;verbosity=detailed". But this is not the default for dotnet test because internally there are multiple instances of vstest.console being run, and so outputing just 1 summary line per instance (per test assembly) is more desirable.

The change could be done, but in order to do that we would have redesign how tests are being run.

We are also working on a reporter that is using msbuild in a more standard way. This is implemented in net9 #2702 (comment) and can be enabled by providing /p:VsTestUseMSBuildOutput=true build property. We hope to integrate this better with the new msbuild logger, which should give better summaries, and experience that integrates well with the other msbuild related tools.

@juwens
Copy link

juwens commented Apr 2, 2024

it's a little bit ridiculous, that one needs to do parameter gymnastics with --logger:"console;verbosity=detailed" (which is one of the awkwardest parameter syntax i've seen) for a what the majority of coders and console users would call a default behavior. (at least if you look at other languages. rust, mocha, etc.)

I mean we are not talking of "crazy" improvements like grouping by class.

Like this python example:
image

But it would be nice to make "dotnet test" work like a tool from the 2020s. Not like a tool from the 2000s and .NET 1.0.

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

6 participants