Enable CoreCLR UI tests on Apple mobile#33050
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables CoreCLR UI tests for iOS and MacCatalyst platforms, mirroring the existing Android CoreCLR tests implementation. The changes allow the UI test pipeline to build and run tests using the CoreCLR runtime on Apple mobile and desktop platforms, in addition to the existing Mono and Android CoreCLR support.
Key Changes
- Added three new build stages for CoreCLR: iOS, MacCatalyst, and Android (renamed from generic CoreCLR stage)
- Added two new test execution stages: iOS CoreCLR and macOS CoreCLR tests
- Extended build script to support platform-specific target framework selection for CoreCLR builds
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/pipelines/common/ui-tests.yml | Splits the generic CoreCLR build stage into platform-specific stages (Android, iOS, Catalyst) and adds corresponding test execution stages for iOS and macOS CoreCLR tests |
| eng/cake/dotnet.cake | Adds platform detection logic to set appropriate target framework (ios, maccatalyst, android) for CoreCLR builds based on command-line arguments |
| else if (HasArgument("android")) | ||
| { | ||
| properties.Add("TargetFramework", $"{DefaultDotnetVersion}-android"); | ||
| } |
There was a problem hiding this comment.
Missing fallback case for CoreCLR builds when no platform argument is provided. If USE_CORECLR is true but none of the platform arguments (ios, catalyst, maccatalyst, android) are provided, the TargetFramework property will not be set, which could lead to build failures.
Consider adding an else clause to handle this case, either by:
- Defaulting to a specific platform (e.g., Android for backward compatibility)
- Throwing a clear error message indicating which platform argument is required
Example:
else
{
throw new Exception("CoreCLR builds require one of: --ios, --catalyst, --maccatalyst, or --android");
}| } | |
| } | |
| else | |
| { | |
| throw new Exception("CoreCLR builds require one of: --ios, --catalyst, --maccatalyst, or --android"); | |
| } |
|
Closing in favour of #33233 |
Description
This PR enables CoreCLR UI tests, mirroring the existing Android CoreCLR tests implementation.
Fixes Contributes to dotnet/runtime#120056