Skip to content

Commit d97ef94

Browse files
authored
Skip UIScene pre-migration test cases on Xcode 27 (flutter#194755)
Xcode 27 requires iOS apps to be migrated to UIScene. As such, we can't test unmigrated apps anymore, so skip them. We should remove them entirely once Xcode 27 is required by the App Store. Fixes flutter#194513. ## 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. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] 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/CONTRIBUTING.ai.md [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 [flutter/website]: https://github.com/flutter/website [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
1 parent 368b7ae commit d97ef94

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎dev/devicelab/bin/tasks/uiscene_plugin_lifecycle_test_ios.dart‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Future<void> main(List<String> args) async {
6969
);
7070

7171
try {
72+
final int? xcodeMajorVersion = await _xcodeMajorVersion();
7273
final Directory appDir = await _createFlutterModuleApp(
7374
destinationDir: destinationDir,
7475
templatesDir: templatesDir,
@@ -100,6 +101,14 @@ Future<void> main(List<String> args) async {
100101
if (testName != null && scenarioName != testName) {
101102
continue;
102103
}
104+
if (scenarioName.contains('AppNotMigrated') &&
105+
xcodeMajorVersion != null &&
106+
xcodeMajorVersion >= 27) {
107+
section(
108+
'Skipping Scenario $scenarioName (unsupported on Xcode $xcodeMajorVersion)',
109+
);
110+
continue;
111+
}
103112
final List<FileReplacements> replacements = FileReplacements.fromScenario(
104113
scenariosMap[scenarioName]!,
105114
templatesDir: templatesDir,
@@ -158,6 +167,13 @@ Future<void> main(List<String> args) async {
158167
});
159168
}
160169

170+
/// Returns the major version of the selected Xcode, or null if it cannot be determined.
171+
Future<int?> _xcodeMajorVersion() async {
172+
final String output = await eval('xcodebuild', <String>['-version'], canFail: true);
173+
final RegExpMatch? match = RegExp(r'Xcode (\d+)').firstMatch(output);
174+
return match == null ? null : int.tryParse(match.group(1)!);
175+
}
176+
161177
Future<Directory> _createFlutterModuleApp({
162178
required Directory templatesDir,
163179
required Directory destinationDir,

0 commit comments

Comments
 (0)