Skip to content

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Sep 4, 2025

This makes it easier when working with test command to understand which classes are specific to VSTest, and which are specific to Microsoft.Testing.Platform.

Classes outside of these two directories are used by both. This can be refactored further as some of these "common" classes have parts that are VSTest and parts that are MTP, and can be split to more classes for clarity. But that's a separate refactor.

Also cleans up a bit of logic so that it's easier to follow.

@@ -10,21 +10,18 @@

namespace Microsoft.DotNet.Cli.Commands.Test;

internal partial class TestingPlatformCommand : Command, ICustomHelp
internal partial class MicrosoftTestingPlatformTestCommand : Command, ICustomHelp, ICommandDocument
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional interface is for #50638

@Youssef1313 Youssef1313 enabled auto-merge (squash) September 4, 2025 16:15
PrepareEnvironment(parseResult, out TestOptions testOptions, out int degreeOfParallelism);
int degreeOfParallelism = GetDegreeOfParallelism(parseResult);
bool filterModeEnabled = parseResult.HasOption(MicrosoftTestingPlatformOptions.TestModulesFilterOption);
var testOptions = new TestOptions(filterModeEnabled, IsHelp: isHelp);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the isHelp passed to the child processes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in TestApplication class where we start the child process, we check for IsHelp and pass ---help to test app. The only potential broken scenario today is when you try to bypass CLI knowledge of --help and end up passing it to the test app. For example, dotnet test -p:TestingPlatformCommandLineArguments=--help. In this case, CLI doesn't know that we are in help mode.

@Youssef1313
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Youssef1313 Youssef1313 merged commit 6f090b3 into release/10.0.1xx Sep 6, 2025
26 of 27 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/refactor branch September 6, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants