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 option in dotnet test #45859

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

mariam-abdulla
Copy link
Member

No description provided.

mariam-abdulla and others added 30 commits January 3, 2025 13:34
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
…erties' of https://github.com/dotnet/sdk into dev/mabdullah/use-msbuild-apis-to-retrieve-project-properties
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
…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
@@ -187,6 +187,9 @@
<data name="CmdProjectDescription" xml:space="preserve">
<value>Defines the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory.</value>
</data>
<data name="CmdSolutionDescription" xml:space="preserve">
<value>Defines the path of the solution file to run. If not specified, it defaults to the current directory.</value>
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean if --solution is not provided or if no value is passed to --solution?

Copy link
Member Author

Choose a reason for hiding this comment

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

If --solution is not provided.

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

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