[pigeon] Migrate XCTest to Swift Testing#10905
[pigeon] Migrate XCTest to Swift Testing#10905auto-submit[bot] merged 3 commits intoflutter:mainfrom
Conversation
| private var correctListInMap: [AnyHashable: Any?] { ["a": 1, "b": 2, "c": correctList] } | ||
| private var matchingListInMap: [AnyHashable: Any?] { ["a": 1, "b": 2, "c": matchingList] } | ||
| private var differentListInMap: [AnyHashable: Any?] { ["a": 1, "b": 2, "c": differentList] } | ||
|
|
||
| private lazy var correctMapInList: [Any?] = ["a", 2, correctMap] | ||
| private lazy var matchingMapInList: [Any?] = ["a", 2, matchingMap] | ||
| private lazy var differentKeyMapInList: [Any?] = ["a", 2, differentKeyMap] | ||
| private lazy var differentValueMapInList: [Any?] = ["a", 2, differentValueMap] | ||
| private var correctMapInList: [Any?] { ["a", 2, correctMap] } | ||
| private var matchingMapInList: [Any?] { ["a", 2, matchingMap] } | ||
| private var differentKeyMapInList: [Any?] { ["a", 2, differentKeyMap] } | ||
| private var differentValueMapInList: [Any?] { ["a", 2, differentValueMap] } |
There was a problem hiding this comment.
Swift 6 has a new warning:
AllDatatypesTests.swift:166:48 Cannot use mutating getter on immutable value: 'self' is immutable"
So make these lazy properties computed properties instead.
There was a problem hiding this comment.
Code Review
This pull request migrates the Pigeon platform tests from XCTest to the new Swift Testing framework. The changes are extensive and mostly look correct, adopting new idioms like @Test, async/await for tests, #expect, and await confirmation.
I've found a pre-existing bug in one of the tests in EnumTests.swift where a value was being compared to itself. I've also suggested an improvement in ListTests.swift to make the test safer and more idiomatic with Swift Testing by using #require.
Additionally, I've noticed a pattern across several test files where failure cases in API callbacks record a generic "Failed" message. I've left comments with suggestions to include the specific error in the issue record for better debuggability. This would make the tests more informative when they fail.
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/EnumTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AsyncHandlersTest.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/EnumTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/MultipleArityTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/NullableReturnsTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/ProxyApiTests.swift
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/RunnerTests.swift
Show resolved
Hide resolved
| 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; | ||
| 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; | ||
| E04641FA2A46270400661C9E /* NSNullFieldTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E04641F92A46270400661C9E /* NSNullFieldTests.swift */; }; | ||
| F750BDEE2F28844900E3DB39 /* ProxyApiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F750BDED2F28844900E3DB39 /* ProxyApiTests.swift */; }; |
There was a problem hiding this comment.
Huh, this wasn't included in the project, so wasn't actually running.
tarrinneal
left a comment
There was a problem hiding this comment.
THE fAiLUrE mEssage IS geNerIc. it WOULd be More HeLPFUL for dEbuGGInG TO inCLUDe tHE actUal eRROr tHaT WAS RECEivED.
Actually though, this is much nicer than before. Thank you.
Always want to be helpful to the bots. 🙏 |
flutter/packages@e37af11...1cb2148 2026-01-27 engine-flutter-autoroll@skia.org Roll Flutter from 7165649 to dfd92b7 (22 revisions) (flutter/packages#10914) 2026-01-27 magder@google.com [shared_preferences_foundation] Migrate XCTest to Swift Testing (flutter/packages#10766) 2026-01-27 magder@google.com [pigeon] Migrate XCTest to Swift Testing (flutter/packages#10905) 2026-01-27 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 8b87286 to bd7a4a6 (6 revisions) (flutter/packages#10913) 2026-01-27 47866232+chunhtai@users.noreply.github.com [ci] Add post release label to sync_release_pr workflow (flutter/packages#10864) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#181608) flutter/packages@e37af11...1cb2148 2026-01-27 engine-flutter-autoroll@skia.org Roll Flutter from 7165649 to dfd92b7 (22 revisions) (flutter/packages#10914) 2026-01-27 magder@google.com [shared_preferences_foundation] Migrate XCTest to Swift Testing (flutter/packages#10766) 2026-01-27 magder@google.com [pigeon] Migrate XCTest to Swift Testing (flutter/packages#10905) 2026-01-27 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 8b87286 to bd7a4a6 (6 revisions) (flutter/packages#10913) 2026-01-27 47866232+chunhtai@users.noreply.github.com [ci] Add post release label to sync_release_pr workflow (flutter/packages#10864) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Part of flutter/flutter#180787
Adding CHANGELOG override per #10761 (comment)
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3