Skip to content

Commit 3afdcd1

Browse files
Change MaxParallelTestModulesOption to int (#50548)
1 parent 11ba5fa commit 3afdcd1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ private void InitializeTestExecutionActionQueue(int degreeOfParallelism, TestOpt
177177

178178
private static int GetDegreeOfParallelism(ParseResult parseResult)
179179
{
180-
if (!int.TryParse(parseResult.GetValue(TestingPlatformOptions.MaxParallelTestModulesOption), out int degreeOfParallelism) || degreeOfParallelism <= 0)
180+
var degreeOfParallelism = parseResult.GetValue(TestingPlatformOptions.MaxParallelTestModulesOption);
181+
if (degreeOfParallelism <= 0)
181182
degreeOfParallelism = Environment.ProcessorCount;
182183
return degreeOfParallelism;
183184
}

src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal static class TestingPlatformOptions
5656
Arity = ArgumentArity.ExactlyOne
5757
};
5858

59-
public static readonly Option<string> MaxParallelTestModulesOption = new("--max-parallel-test-modules")
59+
public static readonly Option<int> MaxParallelTestModulesOption = new("--max-parallel-test-modules")
6060
{
6161
Description = CliCommandStrings.CmdMaxParallelTestModulesDescription,
6262
HelpName = CliCommandStrings.CmdNumberName

0 commit comments

Comments
 (0)