Refactor FXIOS-12796 [Swift 6 Migration] Fix main actor isolation warnings that are Swift 6 errors in the XCUITests suite - Batch 3
:scroll: Tickets
:bulb: Description
⚠️ Temporarily set the merge destination to my other PR just so I can check that Bitrise passes ⚠️
- Fix setUp/tearDown warnings in the XCUITests suite by using the
async throwsversion of the methods - Fix main actor isolation warnings for some local state with
@MainActor
See the Swift 6 Migration channel (#tmp-swift-6-migration) for details on how to migrate the setUp and tearDown methods.
Batch 1: https://github.com/mozilla-mobile/firefox-ios/pull/31025 Batch 2: https://github.com/mozilla-mobile/firefox-ios/pull/31027
cc @Cramsden @lmarceau @dataports
:pencil: Checklist
- [x] I filled in the ticket numbers and a description of my work
- [x] I updated the PR name to follow our PR naming guidelines
- [x] I ensured unit tests pass and wrote tests for new code
- [ ] If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
- [ ] If adding telemetry, I read the data stewardship requirements and will request a data review
- [ ] If adding or modifying strings, I read the guidelines and will request a string review from l10n
- [ ] If needed, I updated documentation and added comments to complex code
| Warnings | |
|---|---|
| :warning: | Print() function seems to be used in file firefox-ios/firefox-ios-tests/Tests/XCUITests/DownloadsTests.swift at line 21. Please remove this usage from production code or use BrowserKit Logger. Since bypass label danger-bypass detected we are reporting as warning only for this PR. |
💪 Quality guardian
9 tests files modified. You're a champion of test coverage! 🚀
🥇 Perfect PR size
Smaller PRs are easier to review. Thanks for making life easy for reviewers! ✨
🙌 Friday high-five
Thanks for pushing us across the finish line this week! 🙌
💬 Description craftsman
Great PR description! Reviewers salute you 🫡
✅ Per-file coverage
All changed files meet the threshold of 35.0%.
Generated by :no_entry_sign: Danger Swift against c1504f390f27bc62e354183d068a3fd9720adbf5
Hey @lmarceau how can we get Danger not to fail the PR for this work?
Error 1
🚫 SwiftUI 'Text(""' in file firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift at line 683 needs to be avoided, use Strings.swift localization instead.
For the second error it's a UI test and I also don't see any Text() objects on line 683 of the XCUITests/C_AddressesTests.swift file...
Error 2
🚫 Print() function seems to be used in file firefox-ios/firefox-ios-tests/Tests/XCUITests/DownloadsTests.swift at line 21. Please remove this usage from production code or use BrowserKit Logger.
For this one I think a print should be permissible in the UI tests?
🚫 SwiftUI 'Text(""' in file firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift at line 683 needs to be avoided, use Strings.swift localization instead.
Yes, I have encountered the same type of error from Danger, too. A Text("....") resolves the issue.
🚫 SwiftUI 'Text(""' in file firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift at line 683 needs to be avoided, use Strings.swift localization instead.
Yes, I have encountered the same type of error from Danger, too. A
Text("....")resolves the issue.
Do you know @clarmso which SwiftUI Text(...) it is even complaining about in that file? I don't think I saw one... 😅
Opened a PR to fix the Danger detection in https://github.com/mozilla-mobile/firefox-ios/pull/31159
This pull request has conflicts when rebasing. Could you fix it @ih-codes? 🙏
@lmarceau is there a way we can ignore danger for the print statement in the tests? I didn't really want to actually change any of the UI test code I was touching for this 👀
@lmarceau is there a way we can ignore danger for the print statement in the tests? I didn't really want to actually change any of the UI test code I was touching for this 👀
Yeah let me add an option for that, Ill do that shortly to unblock this
@mergifyio rebase
rebase
✅ Branch has been successfully rebased
🚀 PR merged to main, targeting version: 147.0