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

Add tests for globbing filter #46495

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

mariam-abdulla
Copy link
Member

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

This pull request includes several changes to dotnet-test related files, focusing on improvements to test handling and updating patterns for better consistency and reliability. The most important changes include updates to test methods, adjustments to file paths, and the removal of unnecessary code.

Test Method Updates:

  • Changed test methods from [Theory] with [InlineData] to [Fact] and removed configuration parameters for simplicity. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs) [1] [2]

File Path Adjustments:

  • Updated file paths to use Path.DirectorySeparatorChar for better cross-platform compatibility. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs)
  • Modified file paths in test commands to dynamically use the current target framework. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs)

Code Cleanup:

  • Removed unused imports and constants from test files. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs)
  • Removed unnecessary Compile directive from the project file. (test/dotnet.Tests/dotnet.Tests.csproj)

Consistency Improvements:

  • Replaced hardcoded strings with constants from TestingConstants for better maintainability. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTests.cs, test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs) [1] [2] [3] [4]

Pattern Matching:

  • Updated regex patterns to use helper methods for generating project regex patterns. (test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs)

These changes aim to improve the reliability and maintainability of the test suite by simplifying test methods, ensuring cross-platform compatibility, and using consistent patterns and constants.

Relates to #45927

@mariam-abdulla mariam-abdulla requested a review from a team as a code owner February 4, 2025 11:20
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels Feb 4, 2025
@mariam-abdulla mariam-abdulla removed the untriaged Request triage from a team member label Feb 4, 2025
Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

Is the space to tab change expected?

@mariam-abdulla
Copy link
Member Author

Is the space to tab change expected?

The file looks normal in VS.

@Evangelink Evangelink enabled auto-merge February 4, 2025 19:30
@Evangelink Evangelink merged commit 1ea37d3 into main Feb 4, 2025
36 of 37 checks passed
@Evangelink Evangelink deleted the dev/mabdullah/fix-globbing-filter-in-dotnet-test branch February 4, 2025 20:07
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.

3 participants