From 9a73b2793218575c020a0b96fd4eee7b7013a07a Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 17:39:38 +0200 Subject: [PATCH 01/12] Split MTP and VSTest implementations in separate directories --- src/Cli/dotnet/Commands/Test/{ => MTP}/CustomEventArgs.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/ExitCode.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/INamedPipeBase.cs | 0 .../dotnet/Commands/Test/{ => MTP}/IPC/INamedPipeSerializer.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/IRequest.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/IResponse.cs | 0 .../Test/{ => MTP}/IPC/Models/CommandLineOptionMessages.cs | 0 .../Commands/Test/{ => MTP}/IPC/Models/DiscoveredTestMessages.cs | 0 .../Commands/Test/{ => MTP}/IPC/Models/FileArtifactMessages.cs | 0 .../dotnet/Commands/Test/{ => MTP}/IPC/Models/HandshakeMessage.cs | 0 .../Commands/Test/{ => MTP}/IPC/Models/TestResultMessages.cs | 0 .../dotnet/Commands/Test/{ => MTP}/IPC/Models/TestSessionEvent.cs | 0 .../dotnet/Commands/Test/{ => MTP}/IPC/Models/UnknownMessage.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/VoidResponse.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/NamedPipeBase.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/NamedPipeServer.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/ObjectFieldIds.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/PipeNameDescription.cs | 0 .../Commands/Test/{ => MTP}/IPC/Serializers/BaseSerializer.cs | 0 .../IPC/Serializers/CommandLineOptionMessagesSerializer.cs | 0 .../{ => MTP}/IPC/Serializers/DiscoveredTestMessagesSerializer.cs | 0 .../{ => MTP}/IPC/Serializers/FileArtifactMessagesSerializer.cs | 0 .../Test/{ => MTP}/IPC/Serializers/HandshakeMessageSerializer.cs | 0 .../Test/{ => MTP}/IPC/Serializers/RegisterSerializers.cs | 0 .../{ => MTP}/IPC/Serializers/TestResultMessagesSerializer.cs | 0 .../Test/{ => MTP}/IPC/Serializers/TestSessionEventSerializer.cs | 0 .../Test/{ => MTP}/IPC/Serializers/UnknownMessageSerializer.cs | 0 .../Test/{ => MTP}/IPC/Serializers/VoidResponseSerializer.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Logger.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/MSBuildHandler.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/MSBuildUtility.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Models.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Options.cs | 0 .../dotnet/Commands/Test/{ => MTP}/SolutionAndProjectUtility.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiCodes.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiDetector.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiTerminal.cs | 0 .../Test/{ => MTP}/Terminal/AnsiTerminalTestProgressFrame.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/ErrorMessage.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/ExceptionFlattener.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/FileUtilities.cs | 0 .../Test/{ => MTP}/Terminal/HumanReadableDurationFormatter.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IColor.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IConsole.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/IProgressMessage.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IStopwatch.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/ITerminal.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/NativeMethods.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/NonAnsiTerminal.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/SimpleAnsiTerminal.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/SimpleTerminalBase.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SystemConsole.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/SystemConsoleColor.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/SystemStopwatch.cs | 0 .../Commands/Test/{ => MTP}/Terminal/TargetFrameworkParser.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TerminalColor.cs | 0 .../Commands/Test/{ => MTP}/Terminal/TerminalTestReporter.cs | 0 .../Test/{ => MTP}/Terminal/TerminalTestReporterOptions.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/TestDetailState.cs | 0 .../Commands/Test/{ => MTP}/Terminal/TestNodeResultsState.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestOutcome.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/TestProgressState.cs | 0 .../Test/{ => MTP}/Terminal/TestProgressStateAwareTerminal.cs | 0 .../dotnet/Commands/Test/{ => MTP}/Terminal/TestRunArtifact.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/WarningMessage.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/TestApplication.cs | 0 .../dotnet/Commands/Test/{ => MTP}/TestApplicationActionQueue.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/TestApplicationHandler.cs | 0 .../dotnet/Commands/Test/{ => MTP}/TestModulesFilterHandler.cs | 0 .../dotnet/Commands/Test/{ => MTP}/TestingPlatformCommand.Help.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/TestingPlatformCommand.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/TestingPlatformOptions.cs | 0 src/Cli/dotnet/Commands/Test/{ => MTP}/ValidationUtility.cs | 0 src/Cli/dotnet/Commands/Test/{ => VSTest}/TestCommand.cs | 0 .../dotnet/Commands/Test/{ => VSTest}/VSTestArgumentConverter.cs | 0 src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestFeatureFlag.cs | 0 src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestForwardingApp.cs | 0 src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestTrace.cs | 0 78 files changed, 0 insertions(+), 0 deletions(-) rename src/Cli/dotnet/Commands/Test/{ => MTP}/CustomEventArgs.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/ExitCode.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/INamedPipeBase.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/INamedPipeSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/IRequest.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/IResponse.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/CommandLineOptionMessages.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/DiscoveredTestMessages.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/FileArtifactMessages.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/HandshakeMessage.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/TestResultMessages.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/TestSessionEvent.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/UnknownMessage.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Models/VoidResponse.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/NamedPipeBase.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/NamedPipeServer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/ObjectFieldIds.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/PipeNameDescription.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/BaseSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/CommandLineOptionMessagesSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/DiscoveredTestMessagesSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/FileArtifactMessagesSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/HandshakeMessageSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/RegisterSerializers.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/TestResultMessagesSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/TestSessionEventSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/UnknownMessageSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/IPC/Serializers/VoidResponseSerializer.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Logger.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/MSBuildHandler.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/MSBuildUtility.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Models.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Options.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/SolutionAndProjectUtility.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiCodes.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiDetector.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiTerminal.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/AnsiTerminalTestProgressFrame.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/ErrorMessage.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/ExceptionFlattener.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/FileUtilities.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/HumanReadableDurationFormatter.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IColor.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IConsole.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IProgressMessage.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/IStopwatch.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/ITerminal.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/NativeMethods.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/NonAnsiTerminal.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SimpleAnsiTerminal.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SimpleTerminalBase.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SystemConsole.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SystemConsoleColor.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/SystemStopwatch.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TargetFrameworkParser.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TerminalColor.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TerminalTestReporter.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TerminalTestReporterOptions.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestDetailState.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestNodeResultsState.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestOutcome.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestProgressState.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestProgressStateAwareTerminal.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/TestRunArtifact.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/Terminal/WarningMessage.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestApplication.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestApplicationActionQueue.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestApplicationHandler.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestModulesFilterHandler.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestingPlatformCommand.Help.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestingPlatformCommand.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/TestingPlatformOptions.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => MTP}/ValidationUtility.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => VSTest}/TestCommand.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestArgumentConverter.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestFeatureFlag.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestForwardingApp.cs (100%) rename src/Cli/dotnet/Commands/Test/{ => VSTest}/VSTestTrace.cs (100%) 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 100% rename from src/Cli/dotnet/Commands/Test/MSBuildUtility.cs rename to src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs 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 100% rename from src/Cli/dotnet/Commands/Test/Options.cs rename to src/Cli/dotnet/Commands/Test/MTP/Options.cs 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 100% rename from src/Cli/dotnet/Commands/Test/TestApplication.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs 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 100% rename from src/Cli/dotnet/Commands/Test/TestModulesFilterHandler.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestModulesFilterHandler.cs diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.Help.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestingPlatformCommand.Help.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.Help.cs diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestingPlatformCommand.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs diff --git a/src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformOptions.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/TestingPlatformOptions.cs rename to src/Cli/dotnet/Commands/Test/MTP/TestingPlatformOptions.cs diff --git a/src/Cli/dotnet/Commands/Test/ValidationUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs similarity index 100% rename from src/Cli/dotnet/Commands/Test/ValidationUtility.cs rename to src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs 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 From 5ebba9551ed331a5a347728c26cd35d8263953d8 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 17:40:14 +0200 Subject: [PATCH 02/12] Cleanup unnecessary field --- src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs index d709aa9a9e36..1b666e7ff62c 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs @@ -12,7 +12,6 @@ namespace Microsoft.DotNet.Cli.Commands.Test; internal partial class TestingPlatformCommand : Command, ICustomHelp { - private MSBuildHandler _msBuildHandler; private TerminalTestReporter _output; private TestApplicationActionQueue _actionQueue; @@ -52,7 +51,7 @@ private int RunInternal(ParseResult parseResult) InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); - _msBuildHandler = new(buildOptions, _actionQueue, _output); + var msBuildHandler = new MSBuildHandler(buildOptions, _actionQueue, _output); TestModulesFilterHandler testModulesFilterHandler = new(_actionQueue, _output); if (testOptions.HasFilterMode) @@ -64,12 +63,12 @@ private int RunInternal(ParseResult parseResult) } else { - if (!_msBuildHandler.RunMSBuild()) + if (!msBuildHandler.RunMSBuild()) { return ExitCode.GenericFailure; } - if (!_msBuildHandler.EnqueueTestApplications()) + if (!msBuildHandler.EnqueueTestApplications()) { return ExitCode.GenericFailure; } From 579fee7ff174d55e20eda413b7ac413a3bd2814a Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 17:41:54 +0200 Subject: [PATCH 03/12] Cleanup unnecessary field --- .../Commands/Test/MTP/TestingPlatformCommand.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs index 1b666e7ff62c..2c0726ea6660 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs @@ -13,7 +13,6 @@ namespace Microsoft.DotNet.Cli.Commands.Test; internal partial class TestingPlatformCommand : Command, ICustomHelp { private TerminalTestReporter _output; - private TestApplicationActionQueue _actionQueue; private byte _cancelled; private bool _isDiscovery; @@ -49,10 +48,10 @@ private int RunInternal(ParseResult parseResult) BuildOptions buildOptions = MSBuildUtility.GetBuildOptions(parseResult, degreeOfParallelism); - InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); + var actionQueue = InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); - var msBuildHandler = new MSBuildHandler(buildOptions, _actionQueue, _output); - TestModulesFilterHandler testModulesFilterHandler = new(_actionQueue, _output); + var msBuildHandler = new MSBuildHandler(buildOptions, actionQueue, _output); + var testModulesFilterHandler = new TestModulesFilterHandler(actionQueue, _output); if (testOptions.HasFilterMode) { @@ -74,9 +73,9 @@ private int RunInternal(ParseResult parseResult) } } - _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) && @@ -106,9 +105,9 @@ private void PrepareEnvironment(ParseResult parseResult, out TestOptions testOpt _isRetry = arguments.Contains("--retry-failed-tests"); } - private void InitializeActionQueue(int degreeOfParallelism, TestOptions testOptions, BuildOptions buildOptions) + private TestApplicationActionQueue 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(); From 3069d641f88d195ebdbf40af0eee42f3b59ef9c3 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 17:44:55 +0200 Subject: [PATCH 04/12] Move variable need usage --- src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs index 2c0726ea6660..8824689bbebc 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs @@ -51,10 +51,10 @@ private int RunInternal(ParseResult parseResult) var actionQueue = InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); var msBuildHandler = new MSBuildHandler(buildOptions, actionQueue, _output); - var testModulesFilterHandler = new TestModulesFilterHandler(actionQueue, _output); if (testOptions.HasFilterMode) { + var testModulesFilterHandler = new TestModulesFilterHandler(actionQueue, _output); if (!testModulesFilterHandler.RunWithTestModulesFilter(parseResult)) { return ExitCode.GenericFailure; From 201e6a8f16914162218cf55cdca10e3ef09c6f83 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 17:57:21 +0200 Subject: [PATCH 05/12] A little bit of cleanup --- .../Test/MTP/TestingPlatformCommand.cs | 45 +++++-------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs index 8824689bbebc..27d6bd3dde93 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs @@ -13,10 +13,7 @@ namespace Microsoft.DotNet.Cli.Commands.Test; internal partial class TestingPlatformCommand : Command, ICustomHelp { private TerminalTestReporter _output; - private byte _cancelled; - private bool _isDiscovery; - private bool _isRetry; public TestingPlatformCommand(string name, string description = null) : base(name, description) { @@ -42,10 +39,14 @@ private int RunInternal(ParseResult parseResult) ValidationUtility.ValidateMutuallyExclusiveOptions(parseResult); ValidationUtility.ValidateSolutionOrProjectOrDirectoryOrModulesArePassedCorrectly(parseResult); - PrepareEnvironment(parseResult, out TestOptions testOptions, out int degreeOfParallelism); + int degreeOfParallelism = GetDegreeOfParallelism(parseResult); + bool filterModeEnabled = parseResult.HasOption(TestingPlatformOptions.TestModulesFilterOption); + var testOptions = new TestOptions(filterModeEnabled, IsHelp: parseResult.HasOption(TestingPlatformOptions.HelpOption)); InitializeOutput(degreeOfParallelism, parseResult, testOptions.IsHelp); + SetupCancelKeyPressHandler(); + BuildOptions buildOptions = MSBuildUtility.GetBuildOptions(parseResult, degreeOfParallelism); var actionQueue = InitializeActionQueue(degreeOfParallelism, testOptions, buildOptions); @@ -88,23 +89,6 @@ private int RunInternal(ParseResult parseResult) return exitCode; } - private void PrepareEnvironment(ParseResult parseResult, out TestOptions testOptions, out int degreeOfParallelism) - { - 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 TestApplicationActionQueue InitializeActionQueue(int degreeOfParallelism, TestOptions testOptions, BuildOptions buildOptions) { return new TestApplicationActionQueue(degreeOfParallelism, buildOptions, testOptions, _output, async (TestApplication testApp) => @@ -145,7 +129,11 @@ private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, MinimumExpectedTests = parseResult.GetValue(TestingPlatformOptions.MinimumExpectedTestsOption), }); - _output.TestExecutionStarted(DateTimeOffset.Now, degreeOfParallelism, _isDiscovery, isHelp, _isRetry); + var isDiscovery = parseResult.HasOption(TestingPlatformOptions.ListTestsOption); + // 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, isDiscovery, isHelp, isRetry); } private static int GetDegreeOfParallelism(ParseResult parseResult) @@ -156,19 +144,6 @@ private static int GetDegreeOfParallelism(ParseResult parseResult) 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) From 72667af1b542f683d8277987bc3d9fb9b363b85f Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 18:09:49 +0200 Subject: [PATCH 06/12] Rename --- ....Help.cs => MicrosoftTestingPlatformTestCommand.Help.cs} | 2 +- ...ormCommand.cs => MicrosoftTestingPlatformTestCommand.cs} | 6 ++++-- src/Cli/dotnet/Commands/Test/TestCommandParser.cs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) rename src/Cli/dotnet/Commands/Test/MTP/{TestingPlatformCommand.Help.cs => MicrosoftTestingPlatformTestCommand.Help.cs} (99%) rename src/Cli/dotnet/Commands/Test/MTP/{TestingPlatformCommand.cs => MicrosoftTestingPlatformTestCommand.cs} (95%) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.Help.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs similarity index 99% rename from src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.Help.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs index f9c2d44b291f..42b3b63a9c3e 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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 = []; diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs similarity index 95% rename from src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs index 27d6bd3dde93..3629ef3e032b 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs @@ -10,16 +10,18 @@ namespace Microsoft.DotNet.Cli.Commands.Test; -internal partial class TestingPlatformCommand : Command, ICustomHelp +internal partial class MicrosoftTestingPlatformTestCommand : Command, ICustomHelp, ICommandDocument { private TerminalTestReporter _output; private byte _cancelled; - public TestingPlatformCommand(string name, string description = null) : base(name, description) + public MicrosoftTestingPlatformTestCommand(string name, string description = null) : base(name, description) { TreatUnmatchedTokensAsErrors = false; } + public string DocsLink => "https://aka.ms/dotnet-test"; + public int Run(ParseResult parseResult) { int? exitCode = null; diff --git a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs index 5423117a05dc..fb5906633e0d 100644 --- a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs +++ b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs @@ -227,7 +227,7 @@ 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); From cb6969a540faac7bca9836a0130943e39ce509a2 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 18:13:41 +0200 Subject: [PATCH 07/12] Rename TestingPlatformOptions to MicrosoftTestingPlatformOptions --- .../Commands/Test/MTP/MSBuildUtility.cs | 16 ++-- ....cs => MicrosoftTestingPlatformOptions.cs} | 2 +- .../MicrosoftTestingPlatformTestCommand.cs | 20 ++--- .../Commands/Test/MTP/TestApplication.cs | 8 +- .../Test/MTP/TestModulesFilterHandler.cs | 6 +- .../Commands/Test/MTP/ValidationUtility.cs | 12 +-- .../dotnet/Commands/Test/TestCommandParser.cs | 34 ++++---- .../GivenDotnetTestBuildsAndDiscoversTests.cs | 16 ++-- .../Test/GivenDotnetTestBuildsAndRunsHelp.cs | 10 +-- ...tBuildsAndRunsTestBasedOnGlobbingFilter.cs | 8 +- .../Test/GivenDotnetTestBuildsAndRunsTests.cs | 40 ++++----- ...etTestBuildsAndRunsTestsForMultipleTFMs.cs | 8 +- ...tnetTestBuildsAndRunsTestsWithArtifacts.cs | 4 +- ...tBuildsAndRunsTestsWithDifferentOptions.cs | 82 +++++++++---------- ...otnetTestRunsConsoleAppWithoutHandshake.cs | 2 +- 15 files changed, 134 insertions(+), 134 deletions(-) rename src/Cli/dotnet/Commands/Test/MTP/{TestingPlatformOptions.cs => MicrosoftTestingPlatformOptions.cs} (98%) diff --git a/src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs index dbea10f3605b..3564b87e4053 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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/MTP/TestingPlatformOptions.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs similarity index 98% rename from src/Cli/dotnet/Commands/Test/MTP/TestingPlatformOptions.cs rename to src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs index 7af4790996a7..288e965a0aa6 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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") { diff --git a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs index 3629ef3e032b..c78d92c68c79 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs @@ -42,8 +42,8 @@ private int RunInternal(ParseResult parseResult) ValidationUtility.ValidateSolutionOrProjectOrDirectoryOrModulesArePassedCorrectly(parseResult); int degreeOfParallelism = GetDegreeOfParallelism(parseResult); - bool filterModeEnabled = parseResult.HasOption(TestingPlatformOptions.TestModulesFilterOption); - var testOptions = new TestOptions(filterModeEnabled, IsHelp: parseResult.HasOption(TestingPlatformOptions.HelpOption)); + bool filterModeEnabled = parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption); + var testOptions = new TestOptions(filterModeEnabled, IsHelp: parseResult.HasOption(MicrosoftTestingPlatformOptions.HelpOption)); InitializeOutput(degreeOfParallelism, parseResult, testOptions.IsHelp); @@ -81,8 +81,8 @@ private int RunInternal(ParseResult parseResult) 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; @@ -113,9 +113,9 @@ private void SetupCancelKeyPressHandler() private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, bool isHelp) { 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); @@ -128,10 +128,10 @@ private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, UseCIAnsi = inCI, ShowAssembly = true, ShowAssemblyStartAndComplete = true, - MinimumExpectedTests = parseResult.GetValue(TestingPlatformOptions.MinimumExpectedTestsOption), + MinimumExpectedTests = parseResult.GetValue(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption), }); - var isDiscovery = parseResult.HasOption(TestingPlatformOptions.ListTestsOption); + var isDiscovery = parseResult.HasOption(MicrosoftTestingPlatformOptions.ListTestsOption); // 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"); @@ -140,7 +140,7 @@ private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, 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; diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs index 8b89216378be..fa0a12c3cffa 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs @@ -112,22 +112,22 @@ private string GetArguments() if (TestOptions.IsHelp) { - builder.Append($" {TestingPlatformOptions.HelpOption.Name}"); + builder.Append($" {MicrosoftTestingPlatformOptions.HelpOption.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/MTP/TestModulesFilterHandler.cs b/src/Cli/dotnet/Commands/Test/MTP/TestModulesFilterHandler.cs index ea4710b2b248..f2524cc9e6d9 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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/MTP/ValidationUtility.cs b/src/Cli/dotnet/Commands/Test/MTP/ValidationUtility.cs index 78955bcc346b..affe08df8fc8 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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 fb5906633e0d..24148d100db2 100644 --- a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs +++ b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs @@ -229,29 +229,29 @@ private static Command GetTestingPlatformCliCommand() { 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.NoLaunchProfileOption); + command.Options.Add(MicrosoftTestingPlatformOptions.NoLaunchProfileArgumentsOption); command.Options.Add(MTPTargetOption); return command; 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..70f758733dde 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(MicrosoftTestingPlatformOptions.HelpOption.Name, 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(MicrosoftTestingPlatformOptions.HelpOption.Name, 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(MicrosoftTestingPlatformOptions.HelpOption.Name, 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"); } From dc5bbddbed287ddc763919c111b53dd65ef80cda Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Thu, 4 Sep 2025 21:47:21 +0200 Subject: [PATCH 08/12] Simplify more --- .../Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs | 5 ----- .../Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs | 2 +- .../Test/MTP/MicrosoftTestingPlatformTestCommand.cs | 8 ++++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs index 288e965a0aa6..30bdb4044fb6 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformOptions.cs @@ -111,11 +111,6 @@ internal static class MicrosoftTestingPlatformOptions 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/MTP/MicrosoftTestingPlatformTestCommand.Help.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs index 42b3b63a9c3e..ee551e4b6d47 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.Help.cs @@ -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/MTP/MicrosoftTestingPlatformTestCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs index c78d92c68c79..4b802a923315 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs @@ -22,12 +22,12 @@ public MicrosoftTestingPlatformTestCommand(string name, string description = nul public string DocsLink => "https://aka.ms/dotnet-test"; - public int Run(ParseResult parseResult) + public int Run(ParseResult parseResult, bool isHelp = false) { int? exitCode = null; try { - exitCode = RunInternal(parseResult); + exitCode = RunInternal(parseResult, isHelp); return exitCode.Value; } finally @@ -36,14 +36,14 @@ public int Run(ParseResult parseResult) } } - private int RunInternal(ParseResult parseResult) + private int RunInternal(ParseResult parseResult, bool isHelp) { ValidationUtility.ValidateMutuallyExclusiveOptions(parseResult); ValidationUtility.ValidateSolutionOrProjectOrDirectoryOrModulesArePassedCorrectly(parseResult); int degreeOfParallelism = GetDegreeOfParallelism(parseResult); bool filterModeEnabled = parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption); - var testOptions = new TestOptions(filterModeEnabled, IsHelp: parseResult.HasOption(MicrosoftTestingPlatformOptions.HelpOption)); + var testOptions = new TestOptions(filterModeEnabled, IsHelp: isHelp); InitializeOutput(degreeOfParallelism, parseResult, testOptions.IsHelp); From 0e0f802399f33defdcd96af091740930906fb0bd Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 5 Sep 2025 08:00:25 +0200 Subject: [PATCH 09/12] Fix --- src/Cli/dotnet/Commands/Test/CliConstants.cs | 1 + src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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/MTP/TestApplication.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs index fa0a12c3cffa..217f19eeb777 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs @@ -112,7 +112,7 @@ private string GetArguments() if (TestOptions.IsHelp) { - builder.Append($" {MicrosoftTestingPlatformOptions.HelpOption.Name}"); + builder.Append($" {CliConstants.HelpOptionKey}"); } if (_buildOptions.PathOptions.ResultsDirectoryPath is { } resultsDirectoryPath) From fa7ce8173cddf913cab0069774c0adc278597c5f Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 5 Sep 2025 08:38:25 +0200 Subject: [PATCH 10/12] Update test --- .../CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs b/test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsHelp.cs index 70f758733dde..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(MicrosoftTestingPlatformOptions.HelpOption.Name, MicrosoftTestingPlatformOptions.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(MicrosoftTestingPlatformOptions.HelpOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(CliConstants.HelpOptionKey, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); if (!TestContext.IsLocalized()) { @@ -72,7 +72,7 @@ public void RunHelpCommand_ShouldNotShowDuplicateOptions(string configuration) CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false) .WithWorkingDirectory(testInstance.Path) - .Execute(MicrosoftTestingPlatformOptions.HelpOption.Name, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); + .Execute(CliConstants.HelpOptionKey, MicrosoftTestingPlatformOptions.ConfigurationOption.Name, configuration); // Parse the help output to extract option names var helpOutput = result.StdOut; From e2c81e6532db6e71b973853798230594f721762e Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 5 Sep 2025 10:05:00 +0200 Subject: [PATCH 11/12] Fix --list-tests --- src/Cli/dotnet/Commands/Test/TestCommandParser.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs index 24148d100db2..4dd09a10fe0a 100644 --- a/src/Cli/dotnet/Commands/Test/TestCommandParser.cs +++ b/src/Cli/dotnet/Commands/Test/TestCommandParser.cs @@ -250,6 +250,7 @@ private static Command GetTestingPlatformCliCommand() 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); From 7beb98c3b4ab1f5d60a4f04a5ae44838e71b601c Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 5 Sep 2025 11:33:53 +0200 Subject: [PATCH 12/12] Fix for discovery --- .../Test/MTP/MicrosoftTestingPlatformTestCommand.cs | 9 ++++----- src/Cli/dotnet/Commands/Test/MTP/Options.cs | 2 +- src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs | 5 +++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs index 4b802a923315..0173829e19fa 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs @@ -43,9 +43,9 @@ private int RunInternal(ParseResult parseResult, bool isHelp) int degreeOfParallelism = GetDegreeOfParallelism(parseResult); bool filterModeEnabled = parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption); - var testOptions = new TestOptions(filterModeEnabled, IsHelp: isHelp); + var testOptions = new TestOptions(filterModeEnabled, IsHelp: isHelp, IsDiscovery: parseResult.HasOption(MicrosoftTestingPlatformOptions.ListTestsOption)); - InitializeOutput(degreeOfParallelism, parseResult, testOptions.IsHelp); + InitializeOutput(degreeOfParallelism, parseResult, testOptions); SetupCancelKeyPressHandler(); @@ -110,7 +110,7 @@ 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(MicrosoftTestingPlatformOptions.OutputOption) == OutputOptions.Detailed; @@ -131,11 +131,10 @@ private void InitializeOutput(int degreeOfParallelism, ParseResult parseResult, MinimumExpectedTests = parseResult.GetValue(MicrosoftTestingPlatformOptions.MinimumExpectedTestsOption), }); - var isDiscovery = parseResult.HasOption(MicrosoftTestingPlatformOptions.ListTestsOption); // 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, isDiscovery, isHelp, isRetry); + _output.TestExecutionStarted(DateTimeOffset.Now, degreeOfParallelism, testOptions.IsDiscovery, testOptions.IsHelp, isRetry); } private static int GetDegreeOfParallelism(ParseResult parseResult) diff --git a/src/Cli/dotnet/Commands/Test/MTP/Options.cs b/src/Cli/dotnet/Commands/Test/MTP/Options.cs index 583e0c34d2e9..88d55069f7cc 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/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/MTP/TestApplication.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs index 217f19eeb777..7b088ab8fb03 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs @@ -115,6 +115,11 @@ private string GetArguments() builder.Append($" {CliConstants.HelpOptionKey}"); } + if (TestOptions.IsDiscovery) + { + builder.Append($" {MicrosoftTestingPlatformOptions.ListTestsOption.Name}"); + } + if (_buildOptions.PathOptions.ResultsDirectoryPath is { } resultsDirectoryPath) { builder.Append($" {MicrosoftTestingPlatformOptions.ResultsDirectoryOption.Name} {ArgumentEscaper.EscapeSingleArg(resultsDirectoryPath)}");