From 1a8ba89a7fff3182123f7dfa8971aeea893c0d47 Mon Sep 17 00:00:00 2001 From: dotnet-maestro-bot Date: Wed, 9 May 2018 00:31:48 +0000 Subject: [PATCH 1/2] Update clicommandlineparser, climigrate, coresetup, coresetup, coresetup, fsharp, sdk, templating, templating, templating, websdk to rtm-62908-03, alpha-62908-03, rtm-26508-02, rtm-26508-02, rtm-26508-02, rtm-180508-0, rtm-62908-02, beta3-20180508-1667431, beta3-20180508-1667431, beta3-20180508-1667431, rtm-20180508-1667423, respectively --- build/DependencyVersions.props | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 67e932b73..998ec02d8 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -3,36 +3,36 @@ 2.1.0-rc1-30661 $(MicrosoftAspNetCoreAllPackageVersion) - 2.1.0-rtm-26505-04 + 2.1.0-rtm-26508-02 $(MicrosoftNETCoreAppPackageVersion) 15.7.177 $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) - 10.1.4-rtm-180505-0 + 10.1.4-rtm-180508-0 2.8.1-beta6-62904-04 $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) - 2.1.300-rtm-62905-02 + 2.1.300-rtm-62908-02 $(MicrosoftNETSdkPackageVersion) $(MicrosoftAspNetCoreAppPackageVersion) - 2.1.300-rtm-20180505-1661707 + 2.1.300-rtm-20180508-1667423 $(MicrosoftNETSdkWebPackageVersion) $(MicrosoftNETSdkWebPackageVersion) - 1.0.2-beta3-20180505-1661716 + 1.0.2-beta3-20180508-1667431 $(MicrosoftDotNetCommonItemTemplatesPackageVersion) - 1.0.2-beta3-20180505-1661716 - 1.0.2-beta3-20180505-1661716 + 1.0.2-beta3-20180508-1667431 + 1.0.2-beta3-20180508-1667431 $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) - 2.1.0-rtm-26505-04 - 2.1.0-rtm-26505-04 - 0.1.1-rtm-62905-02 - 1.3.1-alpha-62905-02 + 2.1.0-rtm-26508-02 + 2.1.0-rtm-26508-02 + 0.1.1-rtm-62908-03 + 1.3.1-alpha-62908-03 $(MicrosoftDotNetProjectJsonMigrationPackageVersion) 0.2.0-beta-62628-01 4.8.0-preview1.5116 From 1feaa0385af4d3fe08fb14127564ae4b501c726e Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Fri, 11 May 2018 17:19:26 -0700 Subject: [PATCH 2/2] Fix incorrect default VSTest verbosity level. Commit 10289504a8aeb5fab7c1c9f8e0e7602e9c14250a 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. --- src/dotnet/ArgumentForwardingExtensions.cs | 3 +++ src/dotnet/commands/dotnet-test/Program.cs | 7 +++---- ...enDotnetTestBuildsAndRunsTestfromCsproj.cs | 21 +++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/dotnet/ArgumentForwardingExtensions.cs b/src/dotnet/ArgumentForwardingExtensions.cs index da4a3cdc9..fb2796094 100644 --- a/src/dotnet/ArgumentForwardingExtensions.cs +++ b/src/dotnet/ArgumentForwardingExtensions.cs @@ -35,6 +35,9 @@ namespace Microsoft.DotNet.Cli .OfType() .SelectMany(o => o.Values); + public static IEnumerable ForwardedOptionValues(this AppliedOption command, string alias) => + (command.ValueOrDefault(alias)?.Values ?? Array.Empty()); + private class ForwardedArgument { public ForwardedArgument(params string[] values) diff --git a/src/dotnet/commands/dotnet-test/Program.cs b/src/dotnet/commands/dotnet-test/Program.cs index 95a8f2418..ac7062f03 100644 --- a/src/dotnet/commands/dotnet-test/Program.cs +++ b/src/dotnet/commands/dotnet-test/Program.cs @@ -60,11 +60,10 @@ namespace Microsoft.DotNet.Tools.Test msbuildArgs.Add($"-property:VSTestCLIRunSettings=\"{runSettingsArg}\""); } - var verbosityArg = msbuildArgs.LastOrDefault(arg => arg.StartsWith("-verbosity")); - - if (!string.IsNullOrEmpty(verbosityArg)) + var verbosityArg = parsedTest.ForwardedOptionValues("verbosity").SingleOrDefault(); + if (verbosityArg != null) { - var verbosity = verbosityArg.Split(':'); + var verbosity = verbosityArg.Split(':', 2); if (verbosity.Length == 2) { msbuildArgs.Add($"-property:VSTestVerbosity={verbosity[1]}"); diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 3b06797aa..8120df7c9 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -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() {