Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
  • Loading branch information
baronfel and Evangelink authored Nov 10, 2022
1 parent 29c336a commit 91c5e63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/Cli/dotnet/commands/dotnet-test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Parsing;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Microsoft.DotNet.Cli;
Expand Down Expand Up @@ -57,10 +56,10 @@ public static int Run(ParseResult parseResult)
return ForwardToVSTestConsole(parseResult, args, settings, testSessionCorrelationId);
}

return ForwardToMsbuild(parseResult, args, settings, testSessionCorrelationId);
return ForwardToMsbuild(parseResult, settings, testSessionCorrelationId);
}

private static int ForwardToMsbuild(ParseResult parseResult, string[] args, string[] settings, string testSessionCorrelationId)
private static int ForwardToMsbuild(ParseResult parseResult, string[] settings, string testSessionCorrelationId)
{
// Workaround for https://github.com/Microsoft/vstest/issues/1503
const string NodeWindowEnvironmentName = "MSBUILDENSURESTDOUTFORTASKPROCESSES";
Expand Down Expand Up @@ -122,7 +121,7 @@ private static TestCommand FromParseResult(ParseResult result, string[] settings
// Extra msbuild properties won't be parsed and so end up in the UnmatchedTokens list. In addition to those
// properties, all the test settings properties are also considered as unmatched but we don't want to forward
// these as-is to msbuild. So we filter out the test settings properties from the unmatched tokens,
// by only taking values until the first item after `--`. (`--` is not present in the UnmatchedTokens ).
// by only taking values until the first item after `--`. (`--` is not present in the UnmatchedTokens).
var unMatchedNonSettingsArgs = settings.Length > 1
? result.UnmatchedTokens.TakeWhile(x => x != settings[1])
: result.UnmatchedTokens;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.DotNet.Cli
{
internal static class TestCommandParser
{
public static readonly string DocsLink = "https://aka.ms/dotnet-test";
public static readonly string DocsLink = "https://aka.ms/dotnet-test";

public static readonly Option<string> SettingsOption = new ForwardedOption<string>(new string[] { "-s", "--settings" }, LocalizableStrings.CmdSettingsDescription)
{
Expand Down

0 comments on commit 91c5e63

Please # to comment.