Skip to content

Migrate flavors_test_ios to Simulators and add UIScene support - #189442

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
okorohelijah:fix_186414
Aug 7, 2026
Merged

Migrate flavors_test_ios to Simulators and add UIScene support#189442
auto-submit[bot] merged 10 commits into
flutter:masterfrom
okorohelijah:fix_186414

Conversation

@okorohelijah

@okorohelijah okorohelijah commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Part of #186414. This PR introduces the testWithNewIOSSimulator helper pattern to execute the flavors_test_ios on macOS VMs rather than physical lab devices. This also migrates the old flavors test app to adopt the UIScene lifecycle using FlutterSceneDelegate.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 14, 2026
@okorohelijah
okorohelijah marked this pull request as draft July 14, 2026 12:38

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several iOS device lab targets in .ci.yaml to run on arm64 hosts, and refactors flavors_test_ios.dart and related integration test utilities to run on a newly created iOS simulator using a provided device ID. It also adds scene manifest configurations to the iOS plist files. A review comment points out that the manual simulator cleanup in flavors_test_ios.dart is redundant and will cause failures because testWithNewIOSSimulator already manages the simulator lifecycle.

Comment thread dev/devicelab/bin/tasks/flavors_test_ios.dart
@okorohelijah
okorohelijah marked this pull request as ready for review July 14, 2026 12:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several iOS devicelab tasks to run on a simulator instead of a physical device, introducing a deviceIdOverride parameter to target specific simulator instances, and configures UIApplicationSceneManifest in the plist files. Feedback highlights two issues: first, wrapping testWithNewIOSSimulator in an outer try-finally block to delete the simulator is redundant and will cause errors; second, when deviceIdOverride is provided, selectedDevice remains null, which will break the withTalkBack check.

Comment thread dev/devicelab/bin/tasks/flavors_test_ios.dart
Comment thread dev/devicelab/lib/tasks/integration_tests.dart
@okorohelijah

okorohelijah commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

This is a prototype PR to propose and discuss the architectural strategy for moving iOS UI/Functional tests off physical lab devices and onto Mac VM simulators (resolving #186414) before applying the pattern broadly.

The Approach:
Instead of ripping these UI tests out of the dev/devicelab harness and rewriting them into the test.dart integration shards, we are keeping them within the Devicelab framework. We decouple the tests from physical hardware by injecting an isolated, ephemeral iOS Simulator during the test's execution phase, allowing us to safely migrate the .ci.yaml targets from the physical hardware pool (Mac_ios) to the standard Swarming VM pool (Mac_arm64).

Why keep them in Devicelab instead of rewriting them?

  1. Preservation of Testing Frameworks: The devicelab tasks heavily utilize the IntegrationTest and DriverTest factory classes, which handle complex, test-specific orchestration (temporary project scaffolding, --dart-define injections, platform setups). Moving to test.dart would require discarding and recreating all this framework glue.

  2. CI Isolation: Devicelab maps one .ci.yaml builder strictly to one test script. When a test crashes or hangs, you immediately get a 1:1 mapped LUCI build failure. Integration shards bunch many tests together, meaning one severe crash/hang can take down the whole shard and mask downstream failures.

  3. Safety & Reversibility: If a specific test ends up catching an obscure bug that only manifests on physical iOS devices, we can instantly revert that specific test back to the Mac_ios hardware pool without needing to rewrite it back into the Devicelab framework.

Trade-offs:

  • Moving away from a globally provisioned simulator (like in test.dart shards) means we incur a small overhead to manage the simulator boot/teardown lifecycle within each isolated task script.

@okorohelijah
okorohelijah requested a review from vashworth July 14, 2026 13:06
@okorohelijah

okorohelijah commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Here is the comprehensive list of Devicelab targets I plan to migrate using this strategy.

Compile-Only Tasks

These tasks only verify that an iOS project can successfully build (running flutter build ios and inspecting the generated artifacts). Because they never invoke devices.workingDevice or launch an app, they can be safely moved to the Mac VM pool with a simple .ci.yaml change. (Note: Tests like build_ios_framework_module_test were already running on Mac_arm64 and are thus omitted).

  • basic_material_app_ios__compile
  • flutter_gallery_ios__compile
  • hello_world_ios__compile
  • imitation_game_flutter__compile
  • imitation_game_swiftui__compile

Functional / UI Tests

These tasks verify UI layout, platform channels, and debugging workflows. While they do require launching an app, they do not measure raw device performance (unlike our benchmarking tasks, which must remain on physical hardware to prevent skewed metrics). We will migrate these by injecting the testWithNewIOSSimulator wrapper.

  • flavors_test_ios (✅ Prototyped in this PR)
  • channels_integration_test_ios
  • external_textures_integration_test_ios
  • route_test_ios
  • integration_test_test_ios
  • integration_ui_ios_driver
  • integration_ui_ios_frame_number
  • integration_ui_ios_keyboard_resize
  • integration_ui_ios_screenshot
  • integration_ui_ios_textfield
  • ios_defines_test
  • hello_world_impeller_ios_sdfs
  • ios_platform_view_tests
  • native_platform_view_ui_tests_ios
  • platform_channel_sample_test_ios
  • platform_channel_sample_test_swift
  • platform_interaction_test_ios
  • spell_check_test_ios
  • keyboard_hot_restart_ios
  • plugin_test_ios
  • module_test_ios
  • module_uiscene_test_ios

Comment thread .ci.yaml Outdated

@vashworth vashworth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM after one request

@vashworth

Copy link
Copy Markdown
Contributor

Here is the comprehensive list of Devicelab targets I plan to migrate using this strategy.

Compile-Only Tasks

These tasks only verify that an iOS project can successfully build (running flutter build ios and inspecting the generated artifacts). Because they never invoke devices.workingDevice or launch an app, they can be safely moved to the Mac VM pool with a simple .ci.yaml change. (Note: Tests like build_ios_framework_module_test were already running on Mac_arm64 and are thus omitted).

  • basic_material_app_ios__compile
  • flutter_gallery_ios__compile
  • hello_world_ios__compile
  • imitation_game_flutter__compile
  • imitation_game_swiftui__compile

Functional / UI Tests

These tasks verify UI layout, platform channels, and debugging workflows. While they do require launching an app, they do not measure raw device performance (unlike our benchmarking tasks, which must remain on physical hardware to prevent skewed metrics). We will migrate these by injecting the testWithNewIOSSimulator wrapper.

  • flavors_test_ios (✅ Prototyped in this PR)
  • channels_integration_test_ios
  • external_ui_integration_test_ios
  • route_test_ios
  • integration_test_test_ios
  • integration_ui_ios_driver
  • integration_ui_ios_frame_number
  • integration_ui_ios_keyboard_resize
  • integration_ui_ios_textfield
  • ios_defines_test
  • hello_world_impeller_ios_sdfs
  • ios_platform_view_tests
  • native_assets_ios
  • native_platform_view_ui_tests_ios
  • platform_channel_sample_test_ios
  • platform_channel_sample_test_swift
  • platform_interaction_test_ios
  • wide_gamut_ios
  • ios_debug_workflow
  • spell_check_test
  • keyboard_hot_restart_ios

Can you move this comment to the tracking issue?

@okorohelijah
okorohelijah requested a review from vashworth August 5, 2026 10:45
Comment thread .ci.yaml Outdated
task_name: route_test_ios

- name: Mac_ios flavors_test_ios
- name: Mac_arm64 flavors_test_ios

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: Mac_arm64 flavors_test_ios
- name: Mac flavors_test_ios

I don't think there's a reason this needs to run exclusively on arm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong

@okorohelijah okorohelijah Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not wrong, I had added it because we are deprecating intel(not that it affects per se) and also intel is slower

Comment thread .ci.yaml Outdated
@okorohelijah
okorohelijah requested a review from vashworth August 7, 2026 18:06
@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2026
@auto-submit

auto-submit Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/189442, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 7, 2026
Merged via the queue into flutter:master with commit cda81a7 Aug 7, 2026
21 of 22 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2026
pull Bot pushed a commit to SaintPatricks-Github-Coinpot-Club/flutter that referenced this pull request Aug 10, 2026
…r#190775)

This PR adds the missing `ruby` (CocoaPods) dependency to the
`flavors_test_ios` target in `.ci.yaml`.
Following the migration of this test from the physical device pool
(`Mac_ios`) to the generic `Mac` simulator pool (in PR flutter#189442), the
target began failing in post-submit bringup with the [error `CocoaPods
not installed or not in valid
state`](https://ci.chromium.org/ui/p/flutter/builders/staging/Mac%20flavors_test_ios/1/overview).
Because the dummy `flavors` app uses the `integration_test` package and
contains an `ios/Podfile`, it requires CocoaPods to compile. Generic Mac
CI bots do not have CocoaPods installed globally, so it must be
explicitly requested in the LUCI `.ci.yaml` dependencies list.

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

Fixes flutter#189442

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
pull Bot pushed a commit to AbhiShake1/flutter that referenced this pull request Aug 12, 2026
Flavors test has been passing, remove from bringup

Fixes flutter#189442

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants