Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,20 @@ Task("uitests-apphost")
{
Information("Building for CoreCLR");
properties.Add("UseMonoRuntime", "false");
properties.Add("TargetFramework", $"{DefaultDotnetVersion}-android");

// Set the target framework based on the platform argument
if (HasArgument("ios"))
{
properties.Add("TargetFramework", $"{DefaultDotnetVersion}-ios");
}
else if (HasArgument("catalyst") || HasArgument("maccatalyst"))
{
properties.Add("TargetFramework", $"{DefaultDotnetVersion}-maccatalyst");
}
else if (HasArgument("android"))
{
properties.Add("TargetFramework", $"{DefaultDotnetVersion}-android");
}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

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:

  1. Defaulting to a specific platform (e.g., Android for backward compatibility)
  2. 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");
}
Suggested change
}
}
else
{
throw new Exception("CoreCLR builds require one of: --ios, --catalyst, --maccatalyst, or --android");
}

Copilot uses AI. Check for mistakes.
}

if (USE_NATIVE_AOT)
Expand Down
128 changes: 125 additions & 3 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ stages:
runtimeVariant: "Mono"
skipProvisioning: ${{ parameters.skipProvisioning }}

- stage: build_ui_tests_coreclr
displayName: Build UITests CoreCLR Sample App
- stage: build_ui_tests_coreclr_android
displayName: Build UITests CoreCLR Android Sample App
dependsOn: []
jobs:
- job: build_ui_tests
Expand All @@ -75,6 +75,41 @@ stages:
- template: ui-tests-build-sample.yml
parameters:
runtimeVariant: "CoreCLR"
platform: android
skipProvisioning: ${{ parameters.skipProvisioning }}

- stage: build_ui_tests_coreclr_ios
displayName: Build UITests CoreCLR iOS Sample App
dependsOn: []
jobs:
- job: build_ui_tests
displayName: Build Sample App
pool: ${{ parameters.iosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-build-sample.yml
parameters:
runtimeVariant: "CoreCLR"
platform: ios
skipProvisioning: ${{ parameters.skipProvisioning }}

- stage: build_ui_tests_coreclr_catalyst
displayName: Build UITests CoreCLR MacCatalyst Sample App
dependsOn: []
jobs:
- job: build_ui_tests
displayName: Build Sample App
pool: ${{ parameters.macosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-build-sample.yml
parameters:
runtimeVariant: "CoreCLR"
platform: catalyst
skipProvisioning: ${{ parameters.skipProvisioning }}

# NativeAOT UI tests build stage - only run when BuildNativeAOT parameter is true
Expand Down Expand Up @@ -157,7 +192,7 @@ stages:

- stage: android_ui_tests_coreclr
displayName: Android UITests CoreClr
dependsOn: build_ui_tests_coreclr
dependsOn: build_ui_tests_coreclr_android
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.android, '') }}:
Expand Down Expand Up @@ -336,6 +371,54 @@ stages:
platform: 'iOS CARV2'
artifactName: 'uitest-snapshot-results-ios-carv2-$(System.JobName)-$(System.JobAttempt)'

- stage: ios_ui_tests_coreclr
displayName: iOS UITests CoreCLR
dependsOn: build_ui_tests_coreclr_ios
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: ios_ui_tests_coreclr_${{ project.name }}_${{ replace(version, '.', '_') }}
strategy:
matrix:
${{ each categoryGroup in parameters.categoryGroupsToTest }}:
${{ categoryGroup }}:
CATEGORYGROUP: ${{ categoryGroup }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }} # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }})
pool: ${{ parameters.iosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-steps.yml
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 18.5
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
app: ${{ project.app }}
${{ if eq(version, 'latest') }}:
device: ios-simulator-64
${{ if ne(version, 'latest') }}:
device: ios-simulator-64_${{ version }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
runtimeVariant: "CoreCLR"
testFilter: $(CATEGORYGROUP)
headless: ${{ parameters.headless }}
skipProvisioning: ${{ parameters.skipProvisioning }}

# Collect and publish iOS CoreCLR snapshot diffs
- template: ui-tests-collect-snapshot-diffs.yml
parameters:
platform: 'iOS CoreCLR'
artifactName: 'uitest-snapshot-results-ios-coreclr-$(System.JobName)-$(System.JobAttempt)'

# NativeAOT iOS UI tests stage - only run when both BuildNativeAOT and RunNativeAOT parameters are true
- ${{ if and(eq(parameters.BuildNativeAOT, true), eq(parameters.RunNativeAOT, true)) }}:
- stage: ios_ui_tests_nativeaot
Expand Down Expand Up @@ -454,3 +537,42 @@ stages:
parameters:
platform: 'Mac'
artifactName: 'uitest-snapshot-results-mac-$(System.JobName)-$(System.JobAttempt)'

- stage: mac_ui_tests_coreclr
displayName: macOS UITests CoreCLR
dependsOn: build_ui_tests_coreclr_catalyst
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.mac, '') }}:
- job: mac_ui_tests_coreclr_${{ project.name }}
strategy:
matrix:
${{ each categoryGroup in parameters.categoryGroupsToTest }}:
${{ categoryGroup }}:
CATEGORYGROUP: ${{ categoryGroup }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }} # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }}
pool: ${{ parameters.macosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-steps.yml
parameters:
platform: catalyst
version: "15.3"
device: mac
path: ${{ project.mac }}
app: ${{ project.app }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
runtimeVariant: "CoreCLR"
testFilter: $(CATEGORYGROUP)
skipProvisioning: ${{ parameters.skipProvisioning }}

# Collect and publish Mac CoreCLR snapshot diffs
- template: ui-tests-collect-snapshot-diffs.yml
parameters:
platform: 'Mac CoreCLR'
artifactName: 'uitest-snapshot-results-mac-coreclr-$(System.JobName)-$(System.JobAttempt)'