-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add tests for solution filter with shared projects and platform configuration support #51526
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
Conversation
- Test for solution filter with shared projects (.shproj) being properly skipped - Test for Platform configuration being respected in solution builds - Both test assets include proper global.json to enable MTP mode Co-authored-by: Youssef1313 <[email protected]>
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
|
|
||
| <GenerateProgramFile>false</GenerateProgramFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove GenerateProgramFile from this project as well as other csproj files added in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed GenerateProgramFile property from all four csproj files in commit 58d1dcc.
|
|
||
| <GenerateProgramFile>false</GenerateProgramFile> | ||
| <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> | ||
| <IsTestingPlatformApplication>true</IsTestingPlatformApplication> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove IsTestingPlatformApplication from this project as well as other csproj files added in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed IsTestingPlatformApplication property from all four csproj files in commit 201ea92.
The property is not needed and was removed from all four csproj files in the test assets. Co-authored-by: Youssef1313 <[email protected]>
The property is not needed and was removed from all four csproj files in the test assets. Co-authored-by: Youssef1313 <[email protected]>
Youssef1313
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Switch from sln to slnx
- Added MultiTestProjectSolutionWithPlatforms.slnx with platform configurations - Added MultiTestProjectSolutionWithSharedProject.slnx with shared project support - Updated TestProjectsWithShared.slnf to reference the slnx file - Kept .sln files for tests that require platform-specific Build configurations which aren't fully supported in slnx yet - Platform configuration test uses .sln for proper Build.0 exclusion support Co-authored-by: Youssef1313 <[email protected]>
Added .slnx files alongside the existing .sln files in commit 922d956. The solution filter now references the .slnx file. Kept the .sln files as well since the platform-specific Build.0 exclusions aren't fully supported in the slnx format yet (the platform configuration test uses .sln for proper Build exclusion support). |
|
@copilot Remove .sln completely from the added test assets. |
- Deleted MultiTestProjectSolutionWithPlatforms.sln - Deleted MultiTestProjectSolutionWithSharedProject.sln - Updated platform configuration test to use .slnx file - Updated slnx Build="false" attribute syntax (removed Project parameter) Note: Platform configuration test currently failing as slnx Build="false" attribute may not be fully supported yet in the SDK's solution parsing logic. Co-authored-by: Youssef1313 <[email protected]>
Removed .sln files from both test assets in commit 0684f5a. Tests now use only .slnx files. Note: The platform configuration test ( |
Adds test coverage for #51398 (solution filters containing .shproj files) and #51481 (Platform configuration support in solution builds).
Tests Added
RunWithSolutionFilterContainingSharedProject_ShouldSkipSharedProjectAndSucceed: Verifies shared projects are automatically filtered out when running tests via solution filters, preventing build failures from non-buildable project types.RunWithSolutionAndPlatformConfiguration_ShouldRespectPlatform: Validates that--property:Platform=<value>correctly filters projects based on solution platform configuration mappings (e.g., only projects configured for x86 run when Platform=x86 is specified). Note: This test currently fails as the slnxBuild="false"attribute may not be fully supported yet in the SDK's solution parsing logic.Test Assets
MultiTestProjectSolutionWithSharedProject: Solution with .slnx file including a .shproj, TestProject (included), and OtherTestProject (excluded by filter). Solution filter references the .slnx file.MultiTestProjectSolutionWithPlatforms: Solution with .slnx file with x64/x86 platform configurations where OtherTestProject is excluded from x86 builds usingBuild="false"attribute.Both assets include
global.jsonwith"test": { "runner": "Microsoft.Testing.Platform" }to enable MTP mode.Changes Made
GenerateProgramFileandIsTestingPlatformApplicationproperties from test csproj files💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.