diff --git a/src/Cli/dotnet/Commands/Test/CliConstants.cs b/src/Cli/dotnet/Commands/Test/CliConstants.cs index 8f8735bad471..ca3cf04dcc0e 100644 --- a/src/Cli/dotnet/Commands/Test/CliConstants.cs +++ b/src/Cli/dotnet/Commands/Test/CliConstants.cs @@ -8,6 +8,7 @@ namespace Microsoft.DotNet.Cli.Commands.Test; internal static class CliConstants { public const string ServerOptionKey = "--server"; + public const string HelpOptionKey = "--help"; public const string DotNetTestPipeOptionKey = "--dotnet-test-pipe"; public const string ServerOptionValue = "dotnettestcli"; diff --git a/src/Cli/dotnet/Commands/Test/CustomEventArgs.cs b/src/Cli/dotnet/Commands/Test/MTP/CustomEventArgs.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/CustomEventArgs.cs rename to src/Cli/dotnet/Commands/Test/MTP/CustomEventArgs.cs diff --git a/src/Cli/dotnet/Commands/Test/ExitCode.cs b/src/Cli/dotnet/Commands/Test/MTP/ExitCode.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/ExitCode.cs rename to src/Cli/dotnet/Commands/Test/MTP/ExitCode.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/INamedPipeBase.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/INamedPipeBase.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/INamedPipeBase.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/INamedPipeBase.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/INamedPipeSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/INamedPipeSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/INamedPipeSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/INamedPipeSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/IRequest.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/IRequest.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/IRequest.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/IRequest.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/IResponse.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/IResponse.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/IResponse.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/IResponse.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/CommandLineOptionMessages.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/CommandLineOptionMessages.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/CommandLineOptionMessages.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/CommandLineOptionMessages.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/DiscoveredTestMessages.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/DiscoveredTestMessages.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/DiscoveredTestMessages.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/DiscoveredTestMessages.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/FileArtifactMessages.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/FileArtifactMessages.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/FileArtifactMessages.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/FileArtifactMessages.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/HandshakeMessage.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/HandshakeMessage.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/HandshakeMessage.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/HandshakeMessage.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/TestResultMessages.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/TestResultMessages.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/TestResultMessages.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/TestResultMessages.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/TestSessionEvent.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/TestSessionEvent.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/TestSessionEvent.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/TestSessionEvent.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/UnknownMessage.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/UnknownMessage.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/UnknownMessage.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/UnknownMessage.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Models/VoidResponse.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Models/VoidResponse.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Models/VoidResponse.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Models/VoidResponse.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/NamedPipeBase.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/NamedPipeBase.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/NamedPipeBase.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/NamedPipeBase.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/NamedPipeServer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/NamedPipeServer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/NamedPipeServer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/NamedPipeServer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/ObjectFieldIds.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/ObjectFieldIds.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/ObjectFieldIds.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/ObjectFieldIds.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/PipeNameDescription.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/PipeNameDescription.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/PipeNameDescription.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/PipeNameDescription.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/BaseSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/BaseSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/BaseSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/BaseSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/CommandLineOptionMessagesSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/CommandLineOptionMessagesSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/CommandLineOptionMessagesSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/CommandLineOptionMessagesSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/DiscoveredTestMessagesSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/DiscoveredTestMessagesSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/DiscoveredTestMessagesSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/DiscoveredTestMessagesSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/FileArtifactMessagesSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/FileArtifactMessagesSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/FileArtifactMessagesSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/FileArtifactMessagesSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/HandshakeMessageSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/HandshakeMessageSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/HandshakeMessageSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/HandshakeMessageSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/RegisterSerializers.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/RegisterSerializers.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/RegisterSerializers.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/RegisterSerializers.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/TestResultMessagesSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/TestResultMessagesSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/TestResultMessagesSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/TestResultMessagesSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/TestSessionEventSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/TestSessionEventSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/TestSessionEventSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/TestSessionEventSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/UnknownMessageSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/UnknownMessageSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/UnknownMessageSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/UnknownMessageSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/IPC/Serializers/VoidResponseSerializer.cs b/src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/VoidResponseSerializer.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/IPC/Serializers/VoidResponseSerializer.cs rename to src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/VoidResponseSerializer.cs diff --git a/src/Cli/dotnet/Commands/Test/Logger.cs b/src/Cli/dotnet/Commands/Test/MTP/Logger.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Logger.cs rename to src/Cli/dotnet/Commands/Test/MTP/Logger.cs diff --git a/src/Cli/dotnet/Commands/Test/MSBuildHandler.cs b/src/Cli/dotnet/Commands/Test/MTP/MSBuildHandler.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/MSBuildHandler.cs rename to src/Cli/dotnet/Commands/Test/MTP/MSBuildHandler.cs diff --git a/src/Cli/dotnet/Commands/Test/MSBuildUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs similarity index 89% rename from src/Cli/dotnet/Commands/Test/MSBuildUtility.cs rename to src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs index dbea10f3605b..3564b87e4053 100644 --- a/src/Cli/dotnet/Commands/Test/MSBuildUtility.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs @@ -66,27 +66,27 @@ public static BuildOptions GetBuildOptions(ParseResult parseResult, int degreeOf var msbuildArgs = parseResult.OptionValuesToBeForwarded(TestCommandParser.GetCommand()) .Concat(binLogArgs); - string? resultsDirectory = parseResult.GetValue(TestingPlatformOptions.ResultsDirectoryOption); + string? resultsDirectory = parseResult.GetValue(MicrosoftTestingPlatformOptions.ResultsDirectoryOption); if (resultsDirectory is not null) { resultsDirectory = Path.GetFullPath(resultsDirectory); } - string? configFile = parseResult.GetValue(TestingPlatformOptions.ConfigFileOption); + string? configFile = parseResult.GetValue(MicrosoftTestingPlatformOptions.ConfigFileOption); if (configFile is not null) { configFile = Path.GetFullPath(configFile); } - string? diagnosticOutputDirectory = parseResult.GetValue(TestingPlatformOptions.DiagnosticOutputDirectoryOption); + string? diagnosticOutputDirectory = parseResult.GetValue(MicrosoftTestingPlatformOptions.DiagnosticOutputDirectoryOption); if (diagnosticOutputDirectory is not null) { diagnosticOutputDirectory = Path.GetFullPath(diagnosticOutputDirectory); } PathOptions pathOptions = new( - parseResult.GetValue(TestingPlatformOptions.ProjectOption), - parseResult.GetValue(TestingPlatformOptions.SolutionOption), + parseResult.GetValue(MicrosoftTestingPlatformOptions.ProjectOption), + parseResult.GetValue(MicrosoftTestingPlatformOptions.SolutionOption), resultsDirectory, configFile, diagnosticOutputDirectory); @@ -94,10 +94,10 @@ public static BuildOptions GetBuildOptions(ParseResult parseResult, int degreeOf return new BuildOptions( pathOptions, parseResult.GetValue(CommonOptions.NoRestoreOption), - parseResult.GetValue(TestingPlatformOptions.NoBuildOption), + parseResult.GetValue(MicrosoftTestingPlatformOptions.NoBuildOption), parseResult.HasOption(TestCommandParser.VerbosityOption) ? parseResult.GetValue(TestCommandParser.VerbosityOption) : null, - parseResult.GetValue(TestingPlatformOptions.NoLaunchProfileOption), - parseResult.GetValue(TestingPlatformOptions.NoLaunchProfileArgumentsOption), + parseResult.GetValue(MicrosoftTestingPlatformOptions.NoLaunchProfileOption), + parseResult.GetValue(MicrosoftTestingPlatformOptions.NoLaunchProfileArgumentsOption), degreeOfParallelism, otherArgs, msbuildArgs); diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs similarity index 96% rename from src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs index 7af4790996a7..30bdb4044fb6 100644 --- a/src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs @@ -7,7 +7,7 @@ namespace Microsoft.DotNet.Cli.Commands.Test; -internal static class TestingPlatformOptions +internal static class MicrosoftTestingPlatformOptions { public static readonly Option ProjectOption = new("--project") { @@ -111,11 +111,6 @@ internal static class TestingPlatformOptions Description = CliCommandStrings.CmdListTestsDescription, Arity = ArgumentArity.Zero }; - - public static readonly Option HelpOption = new("--help", ["-h", "-?"]) - { - Arity = ArgumentArity.Zero - }; } internal enum OutputOptions diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs similarity index 98% rename from src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs index f9c2d44b291f..ee551e4b6d47 100644 --- a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs @@ -9,7 +9,7 @@ namespace Microsoft.DotNet.Cli.Commands.Test; -internal partial class TestingPlatformCommand +internal partial class MicrosoftTestingPlatformTestCommand { private readonly ConcurrentDictionary _commandLineOptionNameToModuleNames = []; private readonly ConcurrentDictionary> _moduleNamesToCommandLineOptions = []; @@ -22,7 +22,7 @@ public IEnumerable> CustomHelpLayout() WriteHelpOptions(context); Console.WriteLine(CliCommandStrings.HelpWaitingForOptionsAndExtensions); - Run(context.ParseResult); + Run(context.ParseResult, isHelp: true); if (_commandLineOptionNameToModuleNames.IsEmpty) { diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs similarity index 54% rename from src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs index d709aa9a9e36..0173829e19fa 100644 --- a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs @@ -10,27 +10,24 @@ namespace Microsoft.DotNet.Cli.Commands.Test; -internal partial class TestingPlatformCommand : Command, ICustomHelp +internal partial class MicrosoftTestingPlatformTestCommand : Command, ICustomHelp, ICommandDocument { - private MSBuildHandler _msBuildHandler; private TerminalTestReporter _output; - private TestApplicationActionQueue _actionQueue; - private byte _cancelled; - private bool _isDiscovery; - private bool _isRetry; - public TestingPlatformCommand(string name, string description = null) : base(name, description) + public MicrosoftTestingPlatformTestCommand(string name, string description = null) : base(name, description) { TreatUnmatchedTokensAsErrors = false; } - public int Run(ParseResult parseResult) + public string DocsLink => "https://aka.ms/dotnet-test"; + + public int Run(ParseResult parseResult, bool isHelp = false) { int? exitCode = null; try { - exitCode = RunInternal(parseResult); + exitCode = RunInternal(parseResult, isHelp); return exitCode.Value; } finally @@ -39,24 +36,28 @@ public int Run(ParseResult parseResult) } } - private int RunInternal(ParseResult parseResult) + private int RunInternal(ParseResult parseResult, bool isHelp) { ValidationUtility.ValidateMutuallyExclusiveOptions(parseResult); ValidationUtility.ValidateSolutionOrProjectOrDirectoryOrModulesArePassedCorrectly(parseResult); - PrepareEnvironment(parseResult, out TestOptions testOptions, out int degreeOfParallelism); + int degreeOfParallelism = GetDegreeOfParallelism(parseResult); + bool filterModeEnabled = parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption); + var testOptions = new TestOptions(filterModeEnabled, IsHelp: isHelp, IsDiscovery: parseResult.HasOption(MicrosoftTestingPlatformOptions.ListTestsOption)); + + InitializeOutput(degreeOfParallelism, parseResult, testOptions); - InitializeOutput(degreeOfParallelism, parseResult, testOptions.IsHelp); + SetupCancelKeyPressHandler(); BuildOptions buildOptions = MSBuildUtility.GetBuildOptions(parseResult, degreeOfParallelism); - InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); + var actionQueue = InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); - _msBuildHandler = new(buildOptions, _actionQueue, _output); - TestModulesFilterHandler testModulesFilterHandler = new(_actionQueue, _output); + var msBuildHandler = new MSBuildHandler(buildOptions, actionQueue, _output); if (testOptions.HasFilterMode) { + var testModulesFilterHandler = new TestModulesFilterHandler(actionQueue, _output); if (!testModulesFilterHandler.RunWithTestModulesFilter(parseResult)) { return ExitCode.GenericFailure; @@ -64,24 +65,24 @@ private int RunInternal(ParseResult parseResult) } else { - if (!_msBuildHandler.RunMSBuild()) + if (!msBuildHandler.RunMSBuild()) { return ExitCode.GenericFailure; } - if (!_msBuildHandler.EnqueueTestApplications()) + if (!msBuildHandler.EnqueueTestApplications()) { return ExitCode.GenericFailure; } } - _actionQueue.EnqueueCompleted(); + actionQueue.EnqueueCompleted(); // Don't inline exitCode variable. We want to always call WaitAllActions first. - var exitCode = _actionQueue.WaitAllActions(); + var exitCode = actionQueue.WaitAllActions(); exitCode = _output.HasHandshakeFailure ? ExitCode.GenericFailure : exitCode; if (exitCode == ExitCode.Success && - parseResult.HasOption(TestingPlatformOptions.MinimumExpectedTestsOption) && - parseResult.GetValue(TestingPlatformOptions.MinimumExpectedTestsOption) is { } minimumExpectedTests && + parseResult.HasOption(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption) && + parseResult.GetValue(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption) is { } minimumExpectedTests && _output.TotalTests < minimumExpectedTests) { exitCode = ExitCode.MinimumExpectedTestsPolicyViolation; @@ -90,26 +91,9 @@ private int RunInternal(ParseResult parseResult) return exitCode; } - private void PrepareEnvironment(ParseResult parseResult, out TestOptions testOptions, out int degreeOfParallelism) + private TestApplicationActionQueue InitializeActionQueue(int degreeOfParallelism, TestOptions testOptions, BuildOptions buildOptions) { - SetupCancelKeyPressHandler(); - - degreeOfParallelism = GetDegreeOfParallelism(parseResult); - - bool filterModeEnabled = parseResult.HasOption(TestingPlatformOptions.TestModulesFilterOption); - - var arguments = parseResult.GetArguments(); - testOptions = GetTestOptions(filterModeEnabled, isHelp: ContainsHelpOption(arguments)); - - _isDiscovery = ContainsListTestsOption(arguments); - - // This is ugly, and we need to replace it by passing out some info from testing platform to inform us that some process level retry plugin is active. - _isRetry = arguments.Contains("--retry-failed-tests"); - } - - private void InitializeActionQueue(int degreeOfParallelism, TestOptions testOptions, BuildOptions buildOptions) - { - _actionQueue = new TestApplicationActionQueue(degreeOfParallelism, buildOptions, testOptions, _output, async (TestApplication testApp) => + return new TestApplicationActionQueue(degreeOfParallelism, buildOptions, testOptions, _output, async (TestApplication testApp) => { testApp.HelpRequested += OnHelpRequested; return await testApp.RunAsync(); @@ -126,12 +110,12 @@ private void SetupCancelKeyPressHandler() }; } - private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, bool isHelp) + private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, TestOptions testOptions) { var console = new SystemConsole(); - var showPassedTests = parseResult.GetValue(TestingPlatformOptions.OutputOption) == OutputOptions.Detailed; - var noProgress = parseResult.HasOption(TestingPlatformOptions.NoProgressOption); - var noAnsi = parseResult.HasOption(TestingPlatformOptions.NoAnsiOption); + var showPassedTests = parseResult.GetValue(MicrosoftTestingPlatformOptions.OutputOption) == OutputOptions.Detailed; + var noProgress = parseResult.HasOption(MicrosoftTestingPlatformOptions.NoProgressOption); + var noAnsi = parseResult.HasOption(MicrosoftTestingPlatformOptions.NoAnsiOption); // TODO: Replace this with proper CI detection that we already have in telemetry. https://github.com/microsoft/testfx/issues/5533#issuecomment-2838893327 bool inCI = string.Equals(Environment.GetEnvironmentVariable("TF_BUILD"), "true", StringComparison.OrdinalIgnoreCase) || string.Equals(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"), "true", StringComparison.OrdinalIgnoreCase); @@ -144,33 +128,23 @@ private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, UseCIAnsi = inCI, ShowAssembly = true, ShowAssemblyStartAndComplete = true, - MinimumExpectedTests = parseResult.GetValue(TestingPlatformOptions.MinimumExpectedTestsOption), + MinimumExpectedTests = parseResult.GetValue(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption), }); - _output.TestExecutionStarted(DateTimeOffset.Now, degreeOfParallelism, _isDiscovery, isHelp, _isRetry); + // This is ugly, and we need to replace it by passing out some info from testing platform to inform us that some process level retry plugin is active. + var isRetry = parseResult.GetArguments().Contains("--retry-failed-tests"); + + _output.TestExecutionStarted(DateTimeOffset.Now, degreeOfParallelism, testOptions.IsDiscovery, testOptions.IsHelp, isRetry); } private static int GetDegreeOfParallelism(ParseResult parseResult) { - var degreeOfParallelism = parseResult.GetValue(TestingPlatformOptions.MaxParallelTestModulesOption); + var degreeOfParallelism = parseResult.GetValue(MicrosoftTestingPlatformOptions.MaxParallelTestModulesOption); if (degreeOfParallelism <= 0) degreeOfParallelism = Environment.ProcessorCount; return degreeOfParallelism; } - private static TestOptions GetTestOptions(bool hasFilterMode, bool isHelp) => - new(hasFilterMode, isHelp); - - private static bool ContainsHelpOption(IEnumerable args) - { - return args.Contains(TestingPlatformOptions.HelpOption.Name) || TestingPlatformOptions.HelpOption.Aliases.Any(alias => args.Contains(alias)); - } - - private static bool ContainsListTestsOption(IEnumerable args) - { - return args.Contains(TestingPlatformOptions.ListTestsOption.Name); - } - private void CompleteRun(int? exitCode) { if (Interlocked.CompareExchange(ref _cancelled, 1, 0) == 0) diff --git a/src/Cli/dotnet/Commands/Test/Models.cs b/src/Cli/dotnet/Commands/Test/MTP/Models.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Models.cs rename to src/Cli/dotnet/Commands/Test/MTP/Models.cs diff --git a/src/Cli/dotnet/Commands/Test/Options.cs b/src/Cli/dotnet/Commands/Test/MTP/Options.cs similarity index 89% rename from src/Cli/dotnet/Commands/Test/Options.cs rename to src/Cli/dotnet/Commands/Test/MTP/Options.cs index 583e0c34d2e9..88d55069f7cc 100644 --- a/src/Cli/dotnet/Commands/Test/Options.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/Options.cs @@ -3,7 +3,7 @@ namespace Microsoft.DotNet.Cli.Commands.Test; -internal record TestOptions(bool HasFilterMode, bool IsHelp); +internal record TestOptions(bool HasFilterMode, bool IsHelp, bool IsDiscovery); internal record PathOptions(string? ProjectPath, string? SolutionPath, string? ResultsDirectoryPath, string? ConfigFilePath, string? DiagnosticOutputDirectoryPath); diff --git a/src/Cli/dotnet/Commands/Test/SolutionAndProjectUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/SolutionAndProjectUtility.cs rename to src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/AnsiCodes.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiCodes.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/AnsiCodes.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiCodes.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/AnsiDetector.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiDetector.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/AnsiDetector.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiDetector.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/AnsiTerminal.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiTerminal.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/AnsiTerminal.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiTerminal.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/AnsiTerminalTestProgressFrame.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiTerminalTestProgressFrame.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/AnsiTerminalTestProgressFrame.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/AnsiTerminalTestProgressFrame.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/ErrorMessage.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/ErrorMessage.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/ErrorMessage.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/ErrorMessage.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/ExceptionFlattener.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/ExceptionFlattener.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/ExceptionFlattener.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/ExceptionFlattener.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/FileUtilities.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/FileUtilities.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/FileUtilities.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/FileUtilities.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/HumanReadableDurationFormatter.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/HumanReadableDurationFormatter.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/HumanReadableDurationFormatter.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/HumanReadableDurationFormatter.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/IColor.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/IColor.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/IColor.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/IColor.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/IConsole.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/IConsole.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/IConsole.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/IConsole.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/IProgressMessage.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/IProgressMessage.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/IProgressMessage.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/IProgressMessage.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/IStopwatch.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/IStopwatch.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/IStopwatch.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/IStopwatch.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/ITerminal.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/ITerminal.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/ITerminal.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/ITerminal.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/NativeMethods.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/NativeMethods.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/NativeMethods.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/NativeMethods.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/NonAnsiTerminal.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/NonAnsiTerminal.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/NonAnsiTerminal.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/NonAnsiTerminal.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/SimpleAnsiTerminal.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/SimpleAnsiTerminal.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/SimpleAnsiTerminal.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/SimpleAnsiTerminal.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/SimpleTerminalBase.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/SimpleTerminalBase.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/SimpleTerminalBase.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/SimpleTerminalBase.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/SystemConsole.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemConsole.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/SystemConsole.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemConsole.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/SystemConsoleColor.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemConsoleColor.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/SystemConsoleColor.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemConsoleColor.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/SystemStopwatch.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemStopwatch.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/SystemStopwatch.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/SystemStopwatch.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TargetFrameworkParser.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TargetFrameworkParser.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TargetFrameworkParser.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TargetFrameworkParser.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TerminalColor.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalColor.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TerminalColor.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalColor.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TerminalTestReporter.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TerminalTestReporter.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TerminalTestReporterOptions.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporterOptions.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TerminalTestReporterOptions.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporterOptions.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestDetailState.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestDetailState.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestDetailState.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestDetailState.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestNodeResultsState.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestNodeResultsState.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestNodeResultsState.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestNodeResultsState.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestOutcome.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestOutcome.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestOutcome.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestOutcome.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestProgressState.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestProgressState.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestProgressState.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestProgressState.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestProgressStateAwareTerminal.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestProgressStateAwareTerminal.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestProgressStateAwareTerminal.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestProgressStateAwareTerminal.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/TestRunArtifact.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/TestRunArtifact.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/TestRunArtifact.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/TestRunArtifact.cs diff --git a/src/Cli/dotnet/Commands/Test/Terminal/WarningMessage.cs b/src/Cli/dotnet/Commands/Test/MTP/Terminal/WarningMessage.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/Terminal/WarningMessage.cs rename to src/Cli/dotnet/Commands/Test/MTP/Terminal/WarningMessage.cs diff --git a/src/Cli/dotnet/Commands/Test/TestApplication.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs similarity index 95% rename from src/Cli/dotnet/Commands/Test/TestApplication.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs index 8b89216378be..7b088ab8fb03 100644 --- a/src/Cli/dotnet/Commands/Test/TestApplication.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs @@ -112,22 +112,27 @@ private string GetArguments() if (TestOptions.IsHelp) { - builder.Append($" {TestingPlatformOptions.HelpOption.Name}"); + builder.Append($" {CliConstants.HelpOptionKey}"); + } + + if (TestOptions.IsDiscovery) + { + builder.Append($" {MicrosoftTestingPlatformOptions.ListTestsOption.Name}"); } if (_buildOptions.PathOptions.ResultsDirectoryPath is { } resultsDirectoryPath) { - builder.Append($" {TestingPlatformOptions.ResultsDirectoryOption.Name} {ArgumentEscaper.EscapeSingleArg(resultsDirectoryPath)}"); + builder.Append($" {MicrosoftTestingPlatformOptions.ResultsDirectoryOption.Name} {ArgumentEscaper.EscapeSingleArg(resultsDirectoryPath)}"); } if (_buildOptions.PathOptions.ConfigFilePath is { } configFilePath) { - builder.Append($" {TestingPlatformOptions.ConfigFileOption.Name} {ArgumentEscaper.EscapeSingleArg(configFilePath)}"); + builder.Append($" {MicrosoftTestingPlatformOptions.ConfigFileOption.Name} {ArgumentEscaper.EscapeSingleArg(configFilePath)}"); } if (_buildOptions.PathOptions.DiagnosticOutputDirectoryPath is { } diagnosticOutputDirectoryPath) { - builder.Append($" {TestingPlatformOptions.DiagnosticOutputDirectoryOption.Name} {ArgumentEscaper.EscapeSingleArg(diagnosticOutputDirectoryPath)}"); + builder.Append($" {MicrosoftTestingPlatformOptions.DiagnosticOutputDirectoryOption.Name} {ArgumentEscaper.EscapeSingleArg(diagnosticOutputDirectoryPath)}"); } foreach (var arg in _buildOptions.UnmatchedTokens) diff --git a/src/Cli/dotnet/Commands/Test/TestApplicationActionQueue.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplicationActionQueue.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestApplicationActionQueue.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestApplicationActionQueue.cs diff --git a/src/Cli/dotnet/Commands/Test/TestApplicationHandler.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestApplicationHandler.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs diff --git a/src/Cli/dotnet/Commands/Test/TestModulesFilterHandler.cs b/src/Cli/dotnet/Commands/Test/MTP/TestModulesFilterHandler.cs similarity index 91% rename from src/Cli/dotnet/Commands/Test/TestModulesFilterHandler.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestModulesFilterHandler.cs index ea4710b2b248..f2524cc9e6d9 100644 --- a/src/Cli/dotnet/Commands/Test/TestModulesFilterHandler.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestModulesFilterHandler.cs @@ -20,14 +20,14 @@ internal sealed class TestModulesFilterHandler(TestApplicationActionQueue action public bool RunWithTestModulesFilter(ParseResult parseResult) { // If the module path pattern(s) was provided, we will use that to filter the test modules - string testModules = parseResult.GetValue(TestingPlatformOptions.TestModulesFilterOption); + string testModules = parseResult.GetValue(MicrosoftTestingPlatformOptions.TestModulesFilterOption); // If the root directory was provided, we will use that to search for the test modules // Otherwise, we will use the current directory string rootDirectory = Directory.GetCurrentDirectory(); - if (parseResult.HasOption(TestingPlatformOptions.TestModulesRootDirectoryOption)) + if (parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesRootDirectoryOption)) { - rootDirectory = parseResult.GetValue(TestingPlatformOptions.TestModulesRootDirectoryOption); + rootDirectory = parseResult.GetValue(MicrosoftTestingPlatformOptions.TestModulesRootDirectoryOption); // If the root directory is not valid, we simply return if (string.IsNullOrEmpty(rootDirectory) || !Directory.Exists(rootDirectory)) diff --git a/src/Cli/dotnet/Commands/Test/ValidationUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs similarity index 91% rename from src/Cli/dotnet/Commands/Test/ValidationUtility.cs rename to src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs index 78955bcc346b..affe08df8fc8 100644 --- a/src/Cli/dotnet/Commands/Test/ValidationUtility.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs @@ -20,13 +20,13 @@ public static void ValidateMutuallyExclusiveOptions(ParseResult parseResult) static void ValidatePathOptions(ParseResult parseResult) { var count = 0; - if (parseResult.HasOption(TestingPlatformOptions.TestModulesFilterOption)) + if (parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption)) count++; - if (parseResult.HasOption(TestingPlatformOptions.SolutionOption)) + if (parseResult.HasOption(MicrosoftTestingPlatformOptions.SolutionOption)) count++; - if (parseResult.HasOption(TestingPlatformOptions.ProjectOption)) + if (parseResult.HasOption(MicrosoftTestingPlatformOptions.ProjectOption)) count++; if (count > 1) @@ -35,14 +35,14 @@ static void ValidatePathOptions(ParseResult parseResult) static void ValidateOptionsIrrelevantToModulesFilter(ParseResult parseResult) { - if (!parseResult.HasOption(TestingPlatformOptions.TestModulesFilterOption)) + if (!parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption)) { return; } if (parseResult.HasOption(CommonOptions.ArchitectureOption) || - parseResult.HasOption(TestingPlatformOptions.ConfigurationOption) || - parseResult.HasOption(TestingPlatformOptions.FrameworkOption) || + parseResult.HasOption(MicrosoftTestingPlatformOptions.ConfigurationOption) || + parseResult.HasOption(MicrosoftTestingPlatformOptions.FrameworkOption) || parseResult.HasOption(CommonOptions.OperatingSystemOption) || parseResult.HasOption(CommonOptions.RuntimeOptionName)) { diff --git a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs index 5423117a05dc..4dd09a10fe0a 100644 --- a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs +++ b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs @@ -227,31 +227,32 @@ private static Command ConstructCommand() private static Command GetTestingPlatformCliCommand() { - var command = new TestingPlatformCommand("test", CliCommandStrings.DotnetTestCommand); + var command = new MicrosoftTestingPlatformTestCommand("test", CliCommandStrings.DotnetTestCommand); command.SetAction(parseResult => command.Run(parseResult)); - command.Options.Add(TestingPlatformOptions.ProjectOption); - command.Options.Add(TestingPlatformOptions.SolutionOption); - command.Options.Add(TestingPlatformOptions.TestModulesFilterOption); - command.Options.Add(TestingPlatformOptions.TestModulesRootDirectoryOption); - command.Options.Add(TestingPlatformOptions.ResultsDirectoryOption); - command.Options.Add(TestingPlatformOptions.ConfigFileOption); - command.Options.Add(TestingPlatformOptions.DiagnosticOutputDirectoryOption); - command.Options.Add(TestingPlatformOptions.MaxParallelTestModulesOption); - command.Options.Add(TestingPlatformOptions.MinimumExpectedTestsOption); + command.Options.Add(MicrosoftTestingPlatformOptions.ProjectOption); + command.Options.Add(MicrosoftTestingPlatformOptions.SolutionOption); + command.Options.Add(MicrosoftTestingPlatformOptions.TestModulesFilterOption); + command.Options.Add(MicrosoftTestingPlatformOptions.TestModulesRootDirectoryOption); + command.Options.Add(MicrosoftTestingPlatformOptions.ResultsDirectoryOption); + command.Options.Add(MicrosoftTestingPlatformOptions.ConfigFileOption); + command.Options.Add(MicrosoftTestingPlatformOptions.DiagnosticOutputDirectoryOption); + command.Options.Add(MicrosoftTestingPlatformOptions.MaxParallelTestModulesOption); + command.Options.Add(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption); command.Options.Add(CommonOptions.ArchitectureOption); command.Options.Add(CommonOptions.PropertiesOption); - command.Options.Add(TestingPlatformOptions.ConfigurationOption); - command.Options.Add(TestingPlatformOptions.FrameworkOption); + command.Options.Add(MicrosoftTestingPlatformOptions.ConfigurationOption); + command.Options.Add(MicrosoftTestingPlatformOptions.FrameworkOption); command.Options.Add(CommonOptions.OperatingSystemOption); command.Options.Add(CommonOptions.RuntimeOption(CliCommandStrings.TestRuntimeOptionDescription)); command.Options.Add(VerbosityOption); command.Options.Add(CommonOptions.NoRestoreOption); - command.Options.Add(TestingPlatformOptions.NoBuildOption); - command.Options.Add(TestingPlatformOptions.NoAnsiOption); - command.Options.Add(TestingPlatformOptions.NoProgressOption); - command.Options.Add(TestingPlatformOptions.OutputOption); - command.Options.Add(TestingPlatformOptions.NoLaunchProfileOption); - command.Options.Add(TestingPlatformOptions.NoLaunchProfileArgumentsOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoBuildOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoAnsiOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoProgressOption); + command.Options.Add(MicrosoftTestingPlatformOptions.OutputOption); + command.Options.Add(MicrosoftTestingPlatformOptions.ListTestsOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoLaunchProfileOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoLaunchProfileArgumentsOption); command.Options.Add(MTPTargetOption); return command; diff --git a/src/Cli/dotnet/Commands/Test/TestCommand.cs b/src/Cli/dotnet/Commands/Test/VSTest/TestCommand.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestCommand.cs rename to src/Cli/dotnet/Commands/Test/VSTest/TestCommand.cs diff --git a/src/Cli/dotnet/Commands/Test/VSTestArgumentConverter.cs b/src/Cli/dotnet/Commands/Test/VSTest/VSTestArgumentConverter.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/VSTestArgumentConverter.cs rename to src/Cli/dotnet/Commands/Test/VSTest/VSTestArgumentConverter.cs diff --git a/src/Cli/dotnet/Commands/Test/VSTestFeatureFlag.cs b/src/Cli/dotnet/Commands/Test/VSTest/VSTestFeatureFlag.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/VSTestFeatureFlag.cs rename to src/Cli/dotnet/Commands/Test/VSTest/VSTestFeatureFlag.cs diff --git a/src/Cli/dotnet/Commands/Test/VSTestForwardingApp.cs b/src/Cli/dotnet/Commands/Test/VSTest/VSTestForwardingApp.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/VSTestForwardingApp.cs rename to src/Cli/dotnet/Commands/Test/VSTest/VSTestForwardingApp.cs diff --git a/src/Cli/dotnet/Commands/Test/VSTestTrace.cs b/src/Cli/dotnet/Commands/Test/VSTest/VSTestTrace.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/VSTestTrace.cs rename to src/Cli/dotnet/Commands/Test/VSTest/VSTestTrace.cs diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-CSharp/Company.TestProject1.csproj index 2a1d1376090c..a8c889eafa29 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-CSharp/Company.TestProject1.csproj @@ -1,5 +1,5 @@  - + net10.0 @@ -43,7 +43,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-FSharp/Company.TestProject1.fsproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-FSharp/Company.TestProject1.fsproj index 9df357f73ca6..40e22d8c07c0 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-FSharp/Company.TestProject1.fsproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-FSharp/Company.TestProject1.fsproj @@ -1,5 +1,5 @@ - + net10.0 @@ -48,7 +48,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj index 2a1d1376090c..a8c889eafa29 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj @@ -1,5 +1,5 @@  - + net10.0 @@ -43,7 +43,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj index 284731cac198..c2484950c146 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj @@ -1,5 +1,5 @@  - + net10.0 @@ -45,7 +45,7 @@ - + diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs index 71f17294f4e7..4026f994dece 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndDiscoversTests.cs @@ -25,7 +25,7 @@ public void DiscoverTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(st CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -49,7 +49,7 @@ public void DiscoverMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericF CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -73,7 +73,7 @@ public void DiscoverTestProjectWithTests_ShouldReturnExitCodeSuccess(string conf CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -95,7 +95,7 @@ public void DiscoverMultipleTestProjectsWithTests_ShouldReturnExitCodeSuccess(st CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -120,7 +120,7 @@ public void DiscoverProjectWithMSTestMetaPackageAndMultipleTFMsWithTests_ShouldR CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -141,7 +141,7 @@ public void DiscoverTestProjectsWithHybridModeTestRunners_ShouldReturnExitCodeGe CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -161,8 +161,8 @@ public void DiscoverTestProjectWithCustomRunArgumentsAndTestEscaping(string conf CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ListTestsOption.Name, - TestingPlatformOptions.ConfigurationOption.Name, configuration, + .Execute(MicrosoftTestingPlatformOptions.ListTestsOption.Name, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, "-p:RunArguments=--hello world \"\" world2", "Another arg with spaces", "My other arg with spaces", diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs index 4ebf43288b3b..1847d3129c19 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs @@ -23,7 +23,7 @@ public void RunHelpOnTestProject_ShouldReturnExitCodeSuccess(string configuratio CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.HelpOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(CliConstants.HelpOptionKey, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -47,7 +47,7 @@ public void RunHelpOnMultipleTestProjects_ShouldReturnExitCodeSuccess(string con CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.HelpOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(CliConstants.HelpOptionKey, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -72,14 +72,14 @@ public void RunHelpCommand_ShouldNotShowDuplicateOptions(string configuration) CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.HelpOption.Name, TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(CliConstants.HelpOptionKey, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); // Parse the help output to extract option names var helpOutput = result.StdOut; // Check for specific options we care about - string outputOptionName = TestingPlatformOptions.OutputOption.Name; // --output - string noAnsiOptionName = TestingPlatformOptions.NoAnsiOption.Name; // --no-ansi + string outputOptionName = MicrosoftTestingPlatformOptions.OutputOption.Name; // --output + string noAnsiOptionName = MicrosoftTestingPlatformOptions.NoAnsiOption.Name; // --no-ansi // Count occurrences of each option in the help output int outputOptionCount = CountOptionOccurrences(helpOutput!, outputOptionName); diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs index c753c33770ce..f795b1ca9f06 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs @@ -29,7 +29,7 @@ public void RunTestProjectWithFilterOfDll_ShouldReturnExitCodeSuccess() CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar)); + .Execute(MicrosoftTestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar)); // Assert that the bin folder hasn't been modified Assert.Equal(binDirectoryLastWriteTime, binDirectory?.LastWriteTime); @@ -72,7 +72,7 @@ public void RunTestProjectsWithFilterOfDll_ShouldReturnExitCodeGenericFailure() CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.TestModulesFilterOption.Name, filterExpression); + .Execute(MicrosoftTestingPlatformOptions.TestModulesFilterOption.Name, filterExpression); // Assert that the bin folder hasn't been modified Assert.Equal(binDirectoryLastWriteTime, binDirectory?.LastWriteTime); @@ -111,8 +111,8 @@ public void RunTestProjectWithFilterOfDllWithRootDirectory_ShouldReturnExitCodeS CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .WithTraceOutput() - .Execute(TestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar), - TestingPlatformOptions.TestModulesRootDirectoryOption.Name, testInstance.TestRoot); + .Execute(MicrosoftTestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar), + MicrosoftTestingPlatformOptions.TestModulesRootDirectoryOption.Name, testInstance.TestRoot); if (!TestContext.IsLocalized()) { diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs index 1885ba114f30..279751a643fa 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTests.cs @@ -24,7 +24,7 @@ public void RunTestProjectWithNoTests_ShouldReturnExitCodeGenericFailure(string CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -49,7 +49,7 @@ public void RunTestProjectWithWithRetryFeature_ShouldSucceed(string configuratio CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -76,7 +76,7 @@ public void RunMultipleTestProjectsWithNoTests_ShouldReturnExitCodeGenericFailur CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -102,7 +102,7 @@ public void RunTestProjectWithTests_ShouldReturnExitCodeSuccess(string configura CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -132,7 +132,7 @@ public void RunTestProjectWithTestsAndLaunchSettings_ShouldReturnExitCodeSuccess CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -161,8 +161,8 @@ public void RunTestProjectWithTestsAndNoLaunchSettings_ShouldReturnExitCodeSucce CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute( - TestingPlatformOptions.ConfigurationOption.Name, configuration, - TestingPlatformOptions.NoLaunchProfileOption.Name); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, + MicrosoftTestingPlatformOptions.NoLaunchProfileOption.Name); result.StdOut.Should() .Contain("FAILED to find argument from launchSettings.json") @@ -180,8 +180,8 @@ public void RunTestProjectWithTestsAndNoLaunchSettingsArguments_ShouldReturnExit CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute( - TestingPlatformOptions.ConfigurationOption.Name, configuration, - TestingPlatformOptions.NoLaunchProfileArgumentsOption.Name, "true"); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, + MicrosoftTestingPlatformOptions.NoLaunchProfileArgumentsOption.Name, "true"); result.StdOut.Should() .Contain("Using launch settings from") @@ -199,7 +199,7 @@ public void RunMultipleTestProjectsWithFailingTests_ShouldReturnExitCodeGenericF CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -226,7 +226,7 @@ public void RunMultipleTestProjectsWithDifferentFailures_ShouldReturnExitCodeGen CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute("--minimum-expected-tests 2", - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -255,7 +255,7 @@ public void RunTestProjectsWithHybridModeTestRunners_ShouldReturnExitCodeGeneric CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -275,7 +275,7 @@ public void RunTestProjectsWithClassLibraryHavingIsTestProjectAndMTPProject_Shou CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -295,7 +295,7 @@ public void RunOnEmptyFolder_ShouldReturnExitCodeGenericFailure(string configura CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -315,7 +315,7 @@ public void RunOnMultipleProjectFoldersWithoutSolutionFile_ShouldReturnExitCodeG CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -335,7 +335,7 @@ public void RunOnProjectWithSolutionFile_ShouldReturnExitCodeGenericFailure(stri CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -356,8 +356,8 @@ public void RunOnProjectWithClassLibrary_ShouldReturnExitCodeSuccess( .WithSource(); string[] args = useFrameworkOption - ? new[] { TestingPlatformOptions.ConfigurationOption.Name, configuration, TestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework } - : new[] { TestingPlatformOptions.ConfigurationOption.Name, configuration }; + ? new[] { MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, MicrosoftTestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework } + : new[] { MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration }; CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) @@ -390,7 +390,7 @@ public void RunningWithGlobalPropertyShouldProperlyPropagate(string configuratio CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute( - TestingPlatformOptions.ConfigurationOption.Name, configuration, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, CommonOptions.PropertiesOption.Name, "PROPERTY_TO_ENABLE_MTP=1"); if (!TestContext.IsLocalized()) @@ -435,7 +435,7 @@ public void RunMTPSolutionWithMinimumExpectedTests(string value, int expectedExi CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.MinimumExpectedTestsOption.Name, value); + .Execute(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption.Name, value); result.ExitCode.Should().Be(expectedExitCode); } diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs index 27e6ee1b59ec..bc3f0e909b1d 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs @@ -27,7 +27,7 @@ public void RunMultipleProjectWithDifferentTFMs_ShouldReturnExitCodeGenericFailu CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -66,7 +66,7 @@ public void RunProjectWithMultipleTFMs_ShouldReturnExitCodeGenericFailure(string CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -156,7 +156,7 @@ public void RunProjectWithMultipleTFMsWithArchOption_ShouldReturnExitCodeGeneric CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration, + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, CommonOptions.ArchitectureOption.Name, arch); if (!TestContext.IsLocalized()) @@ -184,7 +184,7 @@ public void RunProjectWithMSTestMetaPackageAndMultipleTFMs_ShouldReturnExitCodeG CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs index 75d0db9ad8eb..1677ca49276f 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs @@ -23,7 +23,7 @@ public void RunTestProjectWithFailingTestsAndFileArtifacts_ShouldReturnExitCodeG CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -60,7 +60,7 @@ public void RunTestProjectWithCodeCoverage_ShouldReturnExitCodeGenericFailure(st CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute("--coverage", TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute("--coverage", MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs index 6b0b46fc80e8..141eceae2710 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs @@ -26,8 +26,8 @@ public void RunWithProjectPathWithFailingTests_ShouldReturnExitCodeGenericFailur CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, testProjectPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, testProjectPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", true, configuration, "exec", addVersionAndArchPattern: false)); @@ -46,8 +46,8 @@ public void RunWithSolutionPathWithFailingTests_ShouldReturnExitCodeGenericFailu CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.SolutionOption.Name, testSolutionPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.SolutionOption.Name, testSolutionPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, true, configuration), result.StdOut); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("OtherTestProject", TestingConstants.Passed, true, configuration), result.StdOut); @@ -67,8 +67,8 @@ public void RunWithSolutionFilterPathWithFailingTests_ShouldReturnExitCodeGeneri CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.SolutionOption.Name, testSolutionPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.SolutionOption.Name, testSolutionPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, true, configuration), result.StdOut); Assert.DoesNotMatch(RegexPatternHelper.GenerateProjectRegexPattern("OtherTestProject", TestingConstants.Passed, true, configuration), result.StdOut); @@ -86,7 +86,7 @@ public void RunWithSolutionFilterPathInOtherDirectory_ShouldReturnExitCodeGeneri CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory($"{testInstance.Path}{Path.DirectorySeparatorChar}SolutionFilter") - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, true, configuration), result.StdOut); Assert.DoesNotMatch(RegexPatternHelper.GenerateProjectRegexPattern("OtherTestProject", TestingConstants.Passed, true, configuration), result.StdOut); @@ -105,8 +105,8 @@ public void RunWithInvalidProjectExtension_ShouldReturnExitCodeGenericFailure(st CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, invalidProjectPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, invalidProjectPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); result.StdOut.Should().Contain(string.Format(CliCommandStrings.CmdInvalidProjectFileExtensionErrorDescription, invalidProjectPath)); @@ -124,8 +124,8 @@ public void RunWithDirectoryAsProjectOption_ShouldReturnExitCodeGenericFailure(s CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, projectPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, projectPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); // Validate that only TestProject ran Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, true, configuration), result.StdOut); @@ -145,8 +145,8 @@ public void RunWithInvalidSolutionExtension_ShouldReturnExitCodeGenericFailure(s CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.SolutionOption.Name, invalidSolutionPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.SolutionOption.Name, invalidSolutionPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); result.StdOut.Should().Contain(string.Format(CliCommandStrings.CmdInvalidSolutionFileExtensionErrorDescription, invalidSolutionPath)); @@ -165,9 +165,9 @@ public void RunWithBothProjectAndSolutionOptions_ShouldReturnExitCodeGenericFail CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, testProjectPath, - TestingPlatformOptions.SolutionOption.Name, testSolutionPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, testProjectPath, + MicrosoftTestingPlatformOptions.SolutionOption.Name, testSolutionPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); result.StdErr.Should().Contain(CliCommandStrings.CmdMultipleBuildPathOptionsErrorDescription); @@ -185,8 +185,8 @@ public void RunWithNonExistentProjectPath_ShouldReturnExitCodeGenericFailure(str CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, testProjectPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, testProjectPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); string fullProjectPath = $"{testInstance.TestRoot}{Path.DirectorySeparatorChar}{testProjectPath}"; result.StdOut.Should().Contain(string.Format(CliCommandStrings.CmdNonExistentFileErrorDescription, fullProjectPath)); @@ -205,8 +205,8 @@ public void RunWithNonExistentSolutionPath_ShouldReturnExitCodeGenericFailure(st CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.SolutionOption.Name, solutionPath, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.SolutionOption.Name, solutionPath, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); string fullSolutionPath = $"{testInstance.TestRoot}{Path.DirectorySeparatorChar}{solutionPath}"; result.StdOut.Should().Contain(string.Format(CliCommandStrings.CmdNonExistentFileErrorDescription, fullSolutionPath)); @@ -226,7 +226,7 @@ public void RunTestProjectWithArchOption_ShouldReturnExitCodeSuccess(string conf CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.ArchitectureOption.Name, arch, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); string runtime = CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(string.Empty, arch); @@ -247,7 +247,7 @@ public void RunTestProjectSolutionWithArchOption_NotSupported(string configurati CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.ArchitectureOption.Name, arch, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -274,7 +274,7 @@ public void RunTestProjectSolutionWithRuntimeOption_ShouldReturnExitCodeSuccess( CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.RuntimeOptionName, runtime, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Passed, true, configuration, runtime: runtime), result.StdOut); @@ -295,7 +295,7 @@ public void RunTestProjectSolutionWithArchAndRuntimeOptions_ShouldReturnExitCode .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.RuntimeOptionName, runtime, CommonOptions.ArchitectureOption.Name, arch, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); result.ExitCode.Should().Be(ExitCodes.GenericFailure); } @@ -313,7 +313,7 @@ public void RunTestProjectSolutionWithOSOption_ShouldReturnExitCodeSuccess(strin CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.OperatingSystemOption.Name, runtime.Split('-')[0], - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Passed, true, configuration, runtime: runtime), result.StdOut); @@ -335,7 +335,7 @@ public void RunTestProjectSolutionWithArchAndOSOptions_ShouldReturnExitCodeSucce .WithWorkingDirectory(testInstance.Path) .Execute(CommonOptions.OperatingSystemOption.Name, runtime.Split('-')[0], CommonOptions.ArchitectureOption.Name, arch, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.Matches(RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Passed, true, configuration, runtime: runtime), result.StdOut); @@ -358,10 +358,10 @@ public void RunSpecificCSProjRunsWithNoBuildAndNoRestoreOptions_ShouldReturnExit CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, "TestProject.csproj", - TestingPlatformOptions.ConfigurationOption.Name, configuration, + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, "TestProject.csproj", + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, CommonOptions.NoRestoreOption.Name, - TestingPlatformOptions.NoBuildOption.Name); + MicrosoftTestingPlatformOptions.NoBuildOption.Name); // Assert that the bin folder hasn't been modified Assert.Equal(binDirectoryLastWriteTime, binDirectory?.LastWriteTime); @@ -378,7 +378,7 @@ public void RunTestProjectSolutionWithBinLogOption_ShouldReturnExitCodeSuccess(s CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute("-bl", TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute("-bl", MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.True(File.Exists(string.Format("{0}{1}{2}", testInstance.TestRoot, Path.DirectorySeparatorChar, CliConstants.BinLogFileName))); @@ -394,8 +394,8 @@ public void RunSpecificCSProjRunsWithMSBuildArgs_ShouldReturnExitCodeSuccess(str CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ProjectOption.Name, "TestProject.csproj", - TestingPlatformOptions.ConfigurationOption.Name, configuration, + .Execute(MicrosoftTestingPlatformOptions.ProjectOption.Name, "TestProject.csproj", + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, "--property:WarningLevel=2", $"--property:Configuration={configuration}"); if (!TestContext.IsLocalized()) @@ -420,7 +420,7 @@ public void RunOnSolutionWithMSBuildArgs_ShouldReturnExitCodeGenericFailure(stri CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration, + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration, "--property:WarningLevel=2"); if (!TestContext.IsLocalized()) @@ -446,8 +446,8 @@ public void RunTestProjectSolutionWithFrameworkOption_ShouldReturnExitCodeSucces CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -480,8 +480,8 @@ public void RunMultiTFMsProjectSolutionWithPreviousFramework_ShouldReturnExitCod // Restore then fails for OtherTestProject, and we run nothing. CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.FrameworkOption.Name, DotnetVersionHelper.GetPreviousDotnetVersion(), - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.FrameworkOption.Name, DotnetVersionHelper.GetPreviousDotnetVersion(), + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); // Output looks similar to the following /* @@ -531,8 +531,8 @@ public void RunMultiTFMsProjectSolutionWithCurrentFramework_ShouldReturnExitCode // In total, 2 passing, 2 skipped, 4 failing CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework, - TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.FrameworkOption.Name, ToolsetInfo.CurrentTargetFramework, + MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -562,7 +562,7 @@ public void RunWithTraceFileLogging_ShouldReturnExitCodeGenericFailure(string co CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .WithEnvironmentVariable(CliConstants.TestTraceLoggingEnvVar, traceFile) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution."); @@ -580,7 +580,7 @@ public void RunWithTraceFileLoggingAndNonExistingDirectory_ShouldReturnExitCodeG CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) .WithEnvironmentVariable(CliConstants.TestTraceLoggingEnvVar, traceFile) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution."); diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestRunsConsoleAppWithoutHandshake.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestRunsConsoleAppWithoutHandshake.cs index 5361c097f0b7..be317b4d5ed4 100644 --- a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestRunsConsoleAppWithoutHandshake.cs +++ b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestRunsConsoleAppWithoutHandshake.cs @@ -25,7 +25,7 @@ public void RunConsoleAppDoesNothing_ShouldReturnCorrectExitCode(string configur CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(TestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); result.ExitCode.Should().Be(ExitCodes.GenericFailure, "dotnet test should fail with a meaningful error when run against console app without MTP handshake"); }