Vstest: dotnet test verbosity level for test output only

Created on 28 Sep 2018  路  7Comments  路  Source: microsoft/vstest

_From @codefactorydevelopment on September 28, 2018 14:10_

If we want to have a list of tests passed in test suite (only overall stats), we need to use at least
dotnet test -v n
verbosity level. But, that one comes with a whole bunch of build output info also.

It would be nice to have a verbosity level that would show tests that were run in suite but without all the build info.

_Copied from original issue: dotnet/cli#10063_

question

Most helpful comment

@codefactorydevelopment: you can specify --logger:"console;verbosity=normal" in your arguments to dotnet test to show passed tests.
Command would look like

dotnet test Test.csproj --logger:"console;verbosity=normal"

All 7 comments

@codefactorydevelopment: you can specify --logger:"console;verbosity=normal" in your arguments to dotnet test to show passed tests.
Command would look like

dotnet test Test.csproj --logger:"console;verbosity=normal"

Closing the thread. Please feel free to re-open if the above command didn't work for you.

It isn't really working for me:

dotnet test '--logger:console;verbosity=minimal' --verbosity quiet --filter FooBar
watch : Started
Build started, please wait...
/usr/local/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.All' specified a Version of `2.2.2`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs [/Users/inkel/foo/bar/bar.csproj]
Build completed.

Test run for /Users/inkel/dev/foo/bar/test/bar/bin/Debug/netcoreapp2.2/API.Tests.dll(.NETCoreApp,Version=v2.2)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 7.0201 Seconds

I'm ok with leaving the build warning, but afterward, I only want to see this:

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 7.0201 Seconds

Is that possible at all?

Note that I'm using --verbosity quiet which, according to dotnet test -h _set the MSBuild verbosity level_.

@inkel The minimal verbosity level is --verbosity quiet, but this will show the below status as designed.

Test run for /Users/inkel/dev/foo/bar/test/bar/bin/Debug/netcoreapp2.2/API.Tests.dll(.NETCoreApp,Version=v2.2)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

@vagisha-nidhi so there's no way to remove the copyright notice? Bummer 馃槥

I tried to silence log output but dotnet test (v2.2) doesn't seem to care at all about such parameters.

dotnet test --filter DisplayName~InitDatabase_RunManually -l "console;verbosity=quiet" --verbosity quiet

prints even all info level log output

You can remove the copyright notice by --nologo

Was this page helpful?
0 / 5 - 0 ratings