Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

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 slnx Build="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 using Build="false" attribute.

Both assets include global.json with "test": { "runner": "Microsoft.Testing.Platform" } to enable MTP mode.

Changes Made

  • Added .slnx files using the new XML-based solution format
  • Updated solution filter to reference .slnx file
  • Removed unnecessary GenerateProgramFile and IsTestingPlatformApplication properties from test csproj files
  • Test assets use only .slnx format (no .sln 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.

- 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]>
Copilot AI changed the title [WIP] Make requested changes to #51411 Add tests for solution filter with shared projects and platform configuration support Nov 3, 2025
Copilot AI requested a review from Youssef1313 November 3, 2025 13:49
Copilot finished work on behalf of Youssef1313 November 3, 2025 13:49
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<GenerateProgramFile>false</GenerateProgramFile>
Copy link
Member

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.

Copy link
Contributor Author

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>
Copy link
Member

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.

Copy link
Contributor Author

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]>
Copilot AI requested a review from Youssef1313 November 4, 2025 11:32
Copilot finished work on behalf of Youssef1313 November 4, 2025 11:32
The property is not needed and was removed from all four csproj files in the test assets.

Co-authored-by: Youssef1313 <[email protected]>
Copilot finished work on behalf of Youssef1313 November 4, 2025 11:41
Copy link
Member

@Youssef1313 Youssef1313 left a 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]>
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot Switch from sln to slnx

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 AI requested a review from Youssef1313 November 11, 2025 16:07
Copilot finished work on behalf of Youssef1313 November 11, 2025 16:07
@Youssef1313
Copy link
Member

@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]>
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot Remove .sln completely from the added test assets.

Removed .sln files from both test assets in commit 0684f5a. Tests now use only .slnx files.

Note: The platform configuration test (RunWithSolutionAndPlatformConfiguration_ShouldRespectPlatform) is currently failing because the slnx Build="false" attribute doesn't appear to be preventing the test runner from executing projects marked as not to be built for specific platforms. This may require updates to the SDK's solution parsing logic to fully support this slnx feature.

Copilot finished work on behalf of Youssef1313 November 11, 2025 16:49
@Youssef1313 Youssef1313 marked this pull request as ready for review November 12, 2025 10:18
@Youssef1313 Youssef1313 merged commit 8a749af into dev/ygerges/parse-sln Nov 12, 2025
7 of 9 checks passed
@Youssef1313 Youssef1313 deleted the copilot/sub-pr-51411 branch November 12, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants