Skip to content

Support .slnf file format in dotnet test#46392

Merged
mariam-abdulla merged 23 commits intomainfrom
dev/mabdullah/support-slnf-in-dotnet-test
Jan 31, 2025
Merged

Support .slnf file format in dotnet test#46392
mariam-abdulla merged 23 commits intomainfrom
dev/mabdullah/support-slnf-in-dotnet-test

Conversation

@mariam-abdulla
Copy link
Copy Markdown
Member

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

This pull request focuses on refactoring and improving the handling of solution and project files in the CLI, as well as enhancing the build process. The most important changes include the introduction of new methods for parsing solution filter files, simplifying the MSBuildHandler class, and updating constants to support solution filter files.

Refactoring and Enhancements:

  • src/Cli/dotnet/SlnFileFactory.cs: Introduced new methods GetSolutionPathFromFilteredSolutionFile and ParseSolutionFilterFile to handle solution filter files, and refactored CreateFromFilteredSolutionFile to use these methods. [1] [2] [3] [4]

Simplification of MSBuildHandler:

Support for Solution Filter Files:

  • src/Cli/dotnet/commands/dotnet-test/CliConstants.cs: Added support for .slnf files by updating the SolutionExtensions array and introducing SolutionFilterExtensionPattern.
  • Solution filter files are now supported using --solution, e.g. dotnet test --solution "TestProjects.slnf".
  • If we run dotnet test and there exists only one .slnf file in the directory, we will run projects inside this .slnf file. But if we have multiple .slnf files, we will throw an error to specify the solution file. If we have 1 solution file (.sln/.slnx) and multiple .slnf files, we run only the solution file.

Relates to #45927

@mariam-abdulla mariam-abdulla requested a review from a team as a code owner January 29, 2025 14:25
@ghost ghost added Area-dotnet test untriaged Request triage from a team member labels Jan 29, 2025
@mariam-abdulla mariam-abdulla enabled auto-merge (squash) January 29, 2025 15:53
Copy link
Copy Markdown
Contributor

@edvilme edvilme left a comment

Choose a reason for hiding this comment

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

Excited to see this getting support! :)

@mariam-abdulla mariam-abdulla removed the untriaged Request triage from a team member label Jan 31, 2025
@mariam-abdulla mariam-abdulla merged commit 5f186f5 into main Jan 31, 2025
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/support-slnf-in-dotnet-test branch January 31, 2025 12:14
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.

5 participants