Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --solution and --directory options in dotnet test #45859

Merged

Conversation

mariam-abdulla
Copy link
Member

@mariam-abdulla mariam-abdulla commented Jan 10, 2025

This pull request includes several changes to improve and refactor the dotnet-test command in the .NET CLI. The changes focus on enhancing file path validation, updating localizable strings, and refactoring the MSBuild handler.

Refactoring and Enhancements:

Code Simplification:

Localization Updates:

New Records:

Removed Obsolete Code:

mariam-abdulla and others added 30 commits January 3, 2025 13:34
…erties' of https://github.com/dotnet/sdk into dev/mabdullah/use-msbuild-apis-to-retrieve-project-properties
…erties' of https://github.com/dotnet/sdk into dev/mabdullah/use-msbuild-apis-to-retrieve-project-properties
@mariam-abdulla mariam-abdulla requested a review from a team as a code owner January 10, 2025 09:52
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels Jan 10, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 9 out of 24 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • src/Cli/dotnet/commands/dotnet-test/LocalizableStrings.resx: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf: Language not supported
  • src/Cli/dotnet/commands/dotnet-test/BuiltInOptions.cs: Evaluated as low risk
  • src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs: Evaluated as low risk
  • src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs: Evaluated as low risk
  • src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs: Evaluated as low risk
  • src/Cli/dotnet/commands/dotnet-test/TestApplication.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)

src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs:25

  • Changing the Run method from async Task to int removes the ability to await asynchronous operations, which could lead to unhandled asynchronous operations and unexpected behavior.
public int Run(ParseResult parseResult)

src/Cli/dotnet/commands/dotnet-test/SolutionAndProjectUtility.cs:81

  • [nitpick] The method GetProjectFilePaths is defined twice in the same file. Consider renaming one of the methods to avoid confusion.
private static string[] GetProjectFilePaths(string directory)

src/Cli/dotnet/commands/dotnet-test/SolutionAndProjectUtility.cs:24

  • The new behavior introduced by the --solution option should be covered by tests to ensure it works as expected.
var possibleSolutionPaths = GetSolutionFilePaths(directory);

src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs Outdated Show resolved Hide resolved
return false;
}

if (!File.Exists(filePath))
Copy link
Member

Choose a reason for hiding this comment

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

@baronfel do you have some helper around filesystem for mocking and more or is it fine to use this check directly?

src/Cli/dotnet/commands/dotnet-test/TestApplication.cs Outdated Show resolved Hide resolved
@ViktorHofer
Copy link
Member

Updating with latest main as we had a build break that just got fixed with 6b3a36d

@mariam-abdulla mariam-abdulla changed the title Support --solution option in dotnet test Support --solution and --directory options in dotnet test Jan 13, 2025
@mariam-abdulla mariam-abdulla merged commit 818246b into main Jan 13, 2025
38 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/support-solution-option-in-dotnet-test branch January 13, 2025 13:46
@Evangelink
Copy link
Member

Relates to #45927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DotNet Test untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants