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 msbuild params in dotnet test #46562

Conversation

mariam-abdulla
Copy link
Member

@mariam-abdulla mariam-abdulla commented Feb 5, 2025

This pull request includes several changes to the dotnet-test command to refactor and simplify the codebase. The most important changes involve the introduction of a new PathOptions record, modifications to the BuildOptions record, and updates to various methods to use these new structures. Additionally, some redundant methods and imports have been removed.

Refactoring and simplification:

  • Introduced PathOptions record and updated BuildOptions to include PathOptions instead of individual path properties. (src/Cli/dotnet/commands/dotnet-test/Options.cs)
  • Updated RunMSBuild method to use PathOptions for path properties. (src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs)
  • Refactored GetProjects method to simplify build and restore logic by combining MSBuild arguments. (src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs) [1] [2]
  • Removed redundant methods and imports, such as IsBinaryLoggerEnabled, GetBuildParameters, and GetCommands. (src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs) [1] [2] [3]

Command and option updates:

  • Updated NoRestoreOption and NoBuildOption to use common options and forwarding functions. (src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs, src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs) [1] [2]
  • Modified GetTestOptions and GetBuildOptions to utilize new PathOptions and handle MSBuild arguments. (src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs) [1] [2]

These changes aim to enhance code maintainability and readability by consolidating path-related options and removing unnecessary complexity.

Relates to #45927

@mariam-abdulla mariam-abdulla requested a review from a team as a code owner February 5, 2025 16:14
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-dotnet test untriaged Request triage from a team member labels Feb 5, 2025
@mariam-abdulla
Copy link
Member Author

I still need to add a couple of integration tests.

@mariam-abdulla mariam-abdulla enabled auto-merge (squash) February 6, 2025 16:39
@mariam-abdulla mariam-abdulla merged commit 6b0ee2d into main Feb 6, 2025
34 of 38 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/support-msbuild-params-option-in-dotnet-test branch February 6, 2025 19:49
@mariam-abdulla mariam-abdulla removed the untriaged Request triage from a team member label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants