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

Console output for minimal and quiet #2191

Merged
merged 33 commits into from Jul 22, 2020

Conversation

hvinett
Copy link
Contributor

@hvinett hvinett commented Sep 24, 2019

Description

modified printing level in verbosity level is quiet

console_suggested

##issue
1836

@vagisha-nidhi
Copy link
Contributor

            if (testsFailed > 0)

Can we figure out testsFailed, totalTests etc from SummaryDictionary? Class level variables won't be needed then.


Refers to: src/vstest.console/Internal/ConsoleLogger.cs:698 in 5bda2ee. [](commit_id = 5bda2ee, deletion_comment = False)

@hvinett
Copy link
Contributor Author

hvinett commented Oct 4, 2019

@adamralph Can you please review the change? I have attached the screenshot too.

@adamralph
Copy link
Contributor

@hvinett I assume this addresses #1836?

I don't have the bandwidth to review the diff, but the results look good. I just have two comments:

  • Is the blank line between the output lines deliberate? Can we remove it?
  • There seem to be two spaces betweeen some of the items in each line. Is that deliberate? Can we try to see how it looks with only space used consistently?

@adamralph
Copy link
Contributor

Oh, two more things:

  • the target framework is not currently displayed
  • time unit (e.g. ms) should be preceded with a space

Taking all my comments into consideration, I would like to see this:

Failed! Total: 1. Pass: 1. Fail: 0. Skip: 0. (239 ms) UnitTestProject2.dll (netcoreapp3.0).
Failed! Total: 1. Pass: 1. Fail: 0. Skip: 0. (239 ms) UnitTestProject4.dll (netcoreapp3.0).

@singhsarab
Copy link
Contributor

@hvinett Can you please take into consideration the feedback shared by @adamralph and push the changes.

if (summary.FailedTests > 0)
{
// Failed! Pass {1} Failed {2} skipped {3} Time : 233 se ({4})
Output.Information(false, ConsoleColor.Red, string.Format(CultureInfo.CurrentCulture, CommandLineResources.TestRunSummaryFailed, summary.TotalTests, summary.PassedTests, summary.FailedTests, summary.SkippedTests, GetFormattedDurationString(summary.TimeSpan), sd.Key.Split('\\').Last(), targetFramework));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. What happens when target framework is not there? Do we always have a target framework?
  2. Directly appending target framework will append the full name of target framework. eg: .NetCoreApp, Version 3.0.
    Do we want to consider appending short folder name (netcoreapp3.0) as suggested by @adamralph ?
    cc: @singhsarab

src/vstest.console/Internal/ConsoleLogger.cs Show resolved Hide resolved
@adamralph
Copy link
Contributor

This seems to be progressing nicely!

My current feedback:

  • I would prefer to have the short TFM rather than the long framework name. I.e. netcoreapp3.0 instead of NetCoreApp, Version 3.0. The short TFM matches what we specify in the project file, and is less verbose (i.e. better for "quiet" output).
  • There should be a space between the time value and the unit. E.g. 93 ms instead of 93ms.
  • I would prefer to have only a single space between the results, instead of two spaces. E.g.
    Passed! Total: 1. Pass: 1. Fail: 0. Skip: 0.
    
    instead of
    Passed!  Total: 1.  Pass: 1.  Fail: 0.  Skip: 0.
    
  • I like the red colouring for when there is a failure. Should we also have yellow colouring for when there is no failure, but some tests are skipped?

Again, taking all my points into account, I'd like to see:

// in yellow, because Skip != 0
Passed! Total: 2. Pass: 1. Fail: 0. Skip: 1. (239 ms) UnitTestProject2.dll (netcoreapp3.0).

@nohwnd
Copy link
Member

nohwnd commented Jun 3, 2020

Removed the empty line that was removed previously in #2039

@nohwnd
Copy link
Member

nohwnd commented Jun 3, 2020

Hmm, since the minimal is the default, and Normal shows the passed tests, this should really affect just the Quiet output. But I would expect quiet to be, well, quiet. But since this was approved above I am just going to go with it, because I see no other option, that would not be a breaking change.

@adamralph
Copy link
Contributor

It looks like some great progress has been made here!

Can we please update the issue description to show the final rendering and make it clear at what levels this output will be shown? Specifically, I would expect minimal to have this new, minimal output rather than the current multi-line output. I would also expect minimal to omit "Starting test execution, please wait..." and "A total of x test files matched the specified pattern.".

minimal is supposed to be minimal, i.e. just show the minimum required to be able to know what happened, so I would expect that to be the single line with the results.

I would expect quiet to be quiet, i.e. don't show anything unless there is a problem.

@nohwnd
Copy link
Member

nohwnd commented Jun 8, 2020

I would expect the same, but the problem is that Minimal is the default output, and changing the default is always problematic. :/

@adamralph
Copy link
Contributor

But that's exactly what happened in #1836, when the default was changed from single line to multi-line. Now we have an opportunity to change it back again.

@nohwnd
Copy link
Member

nohwnd commented Jun 8, 2020

I am more concerned about not being able to see which tests actually failed. Because this output does not report the tests anymore, just the per-source summary.

@adamralph
Copy link
Contributor

OK, then I misunderstood the current proposal. To summarise what I would like to see:

  • minimal — This is the level that I really care about. It should show the one-line summary that this PR is introducing, plus any test failures, and nothing else. This will effectively restore minimal to what it should be (prior to Improve readability of dotnet test #1836) and also improves it. minimal should never have been changed from a single line summary to a multi-line summary. And as I said above, it should not include "Starting test execution, please wait...", "A total of x test files matched the specified pattern.", etc. That is not minimal output.
  • quiet — I'm not too bothered what happens here, but I guess, in order to be "quiet", it shouldn't show anything, and the non-zero return code from dotnet test would indicate failure. I guess it could show the one-line summary if there are failures, but as I said, I don't really care.

@nohwnd nohwnd modified the milestones: 16.7.0, 16.8.0 Jun 16, 2020
@nohwnd
Copy link
Member

nohwnd commented Jul 13, 2020

minimal — This is the level that I really care about. It should show the one-line summary that this PR is introducing, plus any test failures, and nothing else. This will effectively restore minimal to what it should be (prior to #1836) and also improves it. minimal should never have been changed from a single line summary to a multi-line summary. And as I said above, it should not include "Starting test execution, please wait...", "A total of x test files matched the specified pattern.", etc. That is not minimal output.

Aaah okay, reverting back to where I was and just adding the failed results reporting. That is why it was writing the summary after the whole run. not after every assembly. Could have saved myself a lot of work if this would have become clearer before :)

@adamralph
Copy link
Contributor

@nohwnd would it be possible to get an up-to-date screenshot which shows the current output from this PR? I'm finding it difficult to infer from the various changes that are being pushed.

@nohwnd nohwnd force-pushed the ConsoleLoggerVerbosityQuietCase branch from 41927b6 to 54aca6f Compare July 13, 2020 12:49
@nohwnd
Copy link
Member

nohwnd commented Jul 13, 2020

image
Minimal output.

@adamralph
Copy link
Contributor

Thanks @nohwnd.

image

☝️ I assume --nologo will still remove these lines (including the blank line)?

image

☝️ Can we please remove these lines from minimal output?

@nohwnd
Copy link
Member

nohwnd commented Jul 13, 2020

Yes, --nologo will remove those lines.

Removing those lines would be more difficult because the logger parses the verbosity, but in this case the runner is what writes those two lines, and they are also a nice indication that something happens. So I'd rather keep it to get his finally merged.

@adamralph
Copy link
Contributor

OK. It's still a big improvement.

BTW, has the blank line which was removed here and here come back yet again?

@nohwnd
Copy link
Member

nohwnd commented Jul 13, 2020

You are right I reverted to the point where it worked basically as it should, added the change for removing the new line again. Now it should be gone.

@nohwnd
Copy link
Member

nohwnd commented Jul 14, 2020

  • Minimal
    image

  • Minimal abort:
    image

  • quiet:
    image

  • normal:
    image

@adamralph
Copy link
Contributor

adamralph commented Jul 14, 2020

Thanks for the latest screenshots @nohwnd. It's really good to see how the output is progressing.

One observation I have is that the blank line usage seems to be a bit inconsistent:

  • In Minimal, there is a blank line after the skipped message but not in Minimal abort.
  • Similarly, that same blank line serves as a blank line before the summary in Minimal but not in Minimal abort
  • There is a blank line after "A total of 2 test files..." in quiet, but not in normal

Perhaps it's worth doing a full assessment of where blank lines are used and are not used, in order to align everything?

As I mentioned, my chief concern is minimal. My preference would be:

  • No blank line between "A total of 2 test files..." and the summary when there is no other content between them.
  • Blank lines after "A total of 2 test files..." and before the summary when there is some other content between those two lines, e.g. failures, skips, or abort messages

@nohwnd
Copy link
Member

nohwnd commented Jul 14, 2020

That output is coming from approximately 3 places in quite random order, especially in the abort case, there we have output from console logger, collector logger, and blame logger. Sadly that is how the architecture is done. I also don't like the output in the abort cases, it looks messy, but there is not much I can do about it.

@nohwnd nohwnd merged commit 6343278 into microsoft:master Jul 22, 2020
@adamralph
Copy link
Contributor

adamralph commented Jul 22, 2020

🎉 great to see this merged! Is there a rough timeline for 16.8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants