Fix incorrect default VSTest verbosity level.

Commit 10289504a8 changed the default verbosity
option used for MSBuild from `-v:quiet` to `-verbosity:quiet`.  This triggered a
match that was being done against arguments starting with `-verbosity` to
forward the value to VSTest via the `VSTestVerbosity` property.  The result is
that VSTest is using a default verbosity of `quiet`, suppressing error output
that users expect to see.

The fix is to change the check to only match against user-supplied options.
The default level the command uses for MSBuild is not forwarded to VSTest.

Fixes #9229.
This commit is contained in:
Peter Huene 2018-05-11 17:19:26 -07:00
parent d0bcc1e6df
commit 1feaa0385a
No known key found for this signature in database
GPG key ID: E1D265D820213D6A
3 changed files with 27 additions and 4 deletions

View file

@ -110,6 +110,27 @@ namespace Microsoft.DotNet.Cli.Test.Tests
result.ExitCode.Should().Be(1);
}
[Fact]
public void GivenAFailingTestItDisplaysFailureDetails()
{
var testInstance = TestAssets.Get("XunitCore")
.CreateInstance()
.WithSourceFiles();
var result = new DotnetTestCommand()
.WithWorkingDirectory(testInstance.Root.FullName)
.ExecuteWithCapturedOutput();
result.ExitCode.Should().Be(1);
if (!DotnetUnderTest.IsLocalized())
{
result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTest");
result.StdOut.Should().Contain("Assert.Equal() Failure");
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
}
}
[Fact]
public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven()
{