Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ private void InitializeTestExecutionActionQueue(int degreeOfParallelism, TestOpt

private static int GetDegreeOfParallelism(ParseResult parseResult)
{
if (!int.TryParse(parseResult.GetValue(TestingPlatformOptions.MaxParallelTestModulesOption), out int degreeOfParallelism) || degreeOfParallelism <= 0)
var degreeOfParallelism = parseResult.GetValue(TestingPlatformOptions.MaxParallelTestModulesOption);
if (degreeOfParallelism <= 0)
degreeOfParallelism = Environment.ProcessorCount;
return degreeOfParallelism;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal static class TestingPlatformOptions
Arity = ArgumentArity.ExactlyOne
};

public static readonly Option<string> MaxParallelTestModulesOption = new("--max-parallel-test-modules")
public static readonly Option<int> MaxParallelTestModulesOption = new("--max-parallel-test-modules")
{
Description = CliCommandStrings.CmdMaxParallelTestModulesDescription,
HelpName = CliCommandStrings.CmdNumberName
Expand Down