-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[testing] Use latest simulator main #30664
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
# Conflicts: # eng/pipelines/common/ui-tests.yml
# Conflicts: # src/Controls/tests/TestCases.Shared.Tests/UITest.cs
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.
Pull Request Overview
This PR updates the iOS simulator version from a hardcoded value to dynamically pick the latest available simulator, and adjusts related build and test scripts to use the new default version.
- Updated default iOS version constant and matching logic in UI tests.
- Switched
iosVersions
in multiple pipeline definitions to'latest'
. - Aligned common templates and Cake scripts to use 18.4 as the resolved “latest” simulator version.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/Controls/tests/TestCases.Shared.Tests/UITest.cs | Updated _defaultiOSVersion , device-matching logic, and assertion |
eng/pipelines/ui-tests.yml | Changed iosVersions to 'latest' |
eng/pipelines/device-tests.yml | Changed iosVersions to 'latest' |
eng/pipelines/common/ui-tests.yml | Bumped the resolved “latest” version to 18.4 in UI test templates |
eng/pipelines/common/device-tests-jobs.yml | Added mapping for 'latest' to simulator-64 with API 18.4 |
eng/devices/ios.cake | Updated DefaultVersion and DefaultTestDevice constant |
@@ -241,7 +243,9 @@ but both can happen. | |||
var device = (string?)((AppiumApp)App).Driver.Capabilities.GetCapability("deviceName") | |||
?? throw new InvalidOperationException("deviceName capability is missing or null."); | |||
|
|||
if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == "18.0") | |||
environmentName = "ios"; |
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.
This environmentName = "ios";
statement is now unconditional and will override any other environment settings. It should be moved inside the if (device.Contains(" Xs" ...) && platformVersion == _defaultiOSVersion)
block to preserve correct logic.
environmentName = "ios"; |
Copilot uses AI. Check for mistakes.
@@ -255,7 +259,7 @@ but both can happen. | |||
} | |||
else | |||
{ | |||
Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS 17.2) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}'. Follow the steps on the MAUI UI testing wiki."); | |||
//Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); |
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.
[nitpick] Instead of commenting out this assertion, update the failure message to reference the new default iOS version and re-enable the Assert.Fail
so unsupported simulator configurations are caught during test setup.
//Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); | |
Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); |
Copilot uses AI. Check for mistakes.
const string DefaultVersion = "18.0"; | ||
const string DefaultTestDevice = $"ios-simulator-64_{DefaultVersion}"; | ||
const string DefaultVersion = "18.4"; | ||
const string DefaultTestDevice = $"ios-simulator-64"; |
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.
[nitpick] Dropping the version suffix from DefaultTestDevice
may break scripts that expect a versioned identifier. Consider appending DefaultVersion
or updating any downstream logic that parses this string.
const string DefaultTestDevice = $"ios-simulator-64"; | |
const string DefaultTestDevice = $"ios-simulator-64-{DefaultVersion}"; |
Copilot uses AI. Check for mistakes.
/backport to inflight/current |
Started backporting to inflight/current: https://github.com/dotnet/maui/actions/runs/16341556437 |
Description of Change
Try to pick the latest available iOS simulator based on Xcode select and not hardcoded