[tests] We must set 'UseFloatingTargetPlatformVersion=true' for our test projects, to avoid building them with other workloads than the current workload.#24281
Conversation
…est projects, to avoid building them with other workloads than the current workload.
… value of UseFloatingTargetPlatformVersion. So that it can be passed on when executing `dotnet` to compute binding variables, because otherwise we might end up with variables from the wrong workload.
…ClassLibrary' test.
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that test projects build with the correct workload by setting UseFloatingTargetPlatformVersion=true. This prevents tests from inadvertently building with other workloads than the current one.
- Centralized
UseFloatingTargetPlatformVersion=trueinGetDefaultProperties()method to apply to all test builds - Updated all test methods to use
GetDefaultProperties()instead of manually creating property dictionaries - Added
UseFloatingTargetPlatformVersionparameter toComputeRemoteGeneratorPropertiestask to propagate the property when computing binding variables - Set default value in
shared-dotnet.csprojfor all test projects
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/dotnet/UnitTests/TestBaseClass.cs | Added UseFloatingTargetPlatformVersion=true to GetDefaultProperties() method |
| tests/dotnet/UnitTests/XcodeProjectTests.cs | Updated all test methods to use GetDefaultProperties() instead of manual property dictionaries |
| tests/dotnet/UnitTests/TemplateTest.cs | Updated template test methods to use GetDefaultProperties() |
| tests/dotnet/UnitTests/ProjectTest.cs | Added exception for BuildMyClassLibrary test which explicitly verifies workload behavior |
| tests/common/shared-dotnet.csproj | Set default UseFloatingTargetPlatformVersion=true for all test projects |
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Passed UseFloatingTargetPlatformVersion parameter to ComputeRemoteGeneratorProperties task |
| msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeRemoteGeneratorProperties.cs | Added UseFloatingTargetPlatformVersion property and passed it as MSBuild argument when computing properties |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #92caf02] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #92caf02] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build #92caf02] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #92caf02] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #92caf02] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #92caf02] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
💻 [CI Build #92caf02] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #92caf02] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
🚀 [CI Build #92caf02] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 119 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Also the ComputeRemoteGeneratorProperties task needs to know the value of
UseFloatingTargetPlatformVersion, so that it can be passed on when executing
dotnetto compute binding variables, because otherwise we might end up withvariables from the wrong workload.