-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor FXIOS-14344 [Swift 6 migration] Fixing DependencyHelperMock unit tests warning #21
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
base: copilot_combined_20260121_qodo_grep_cursor_copilot_1_base_refactor_fxios-14344_swift_6_migration_fixing_dependencyhelpermock_unit_tests_warning_pr226
Are you sure you want to change the base?
Refactor FXIOS-14344 [Swift 6 migration] Fixing DependencyHelperMock unit tests warning #21
Conversation
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 pull request focuses on migrating unit tests to Swift 6 concurrency by updating the DependencyHelperMock class and its usage across test files. The changes make test setup/teardown methods async and annotate DependencyHelperMock.bootstrapDependencies() with @MainActor to properly handle Swift 6 concurrency requirements.
Changes:
- Refactored
DependencyHelperMockto use@MainActorannotation and removed Thread.isMainThread logic - Updated 59+ test files to use async setUp/tearDown methods with proper await calls
- Removed obsolete
TestSetup.swiftfile and its project references
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| DependencyHelperMock.swift | Added @mainactor annotation to bootstrapDependencies method and simplified main thread handling logic |
| ZoomPageManagerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| WindowManagerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| SponsoredContentFilterUtilityTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TrackingProtectionStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| BlockedTrackersTableViewControllerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| AddressToolbarContainerModelTests.swift | Added await to bootstrapDependencies call in existing async setUp |
| TelemetryContextualIdentifierTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TabsPanelStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TabDisplayPanelTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| RemoteTabPanelTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| RemoteTabPanelStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TabPeekStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TabManagerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call and added reset call to tearDown |
| TabEventHandlerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| SurveySurfaceManagerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| StartAtHomeHelperTests.swift | Updated setUp/tearDown to async with await, removed duplicate bootstrapDependencies call |
| URLActivityItemProviderTests.swift | Updated setUp/tearDown to async, added tearDown method, but missing await on bootstrapDependencies |
| SearchBarLocationSaverTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| PasswordGeneratorViewControllerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| PasswordGeneratorTelemetryTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| PasswordGeneratorStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| UpdateViewModelTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| OnboardingTelemetryUtilityTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| OnboardingNotificationCardHelperTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| NotificationSurfaceManagerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| NativeErrorPageViewControllerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| MicrosurveyViewControllerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| MicrosurveySurfaceManagerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| MicrosurveyStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| MicrosurveyPromptStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| NimbusMessagingTriggerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| NimbusMessagingMessageTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| MainMenuViewControllerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| MainMenuStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| ReadingListPanelTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| LibraryViewModelTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| DownloadsPanelTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| TestSetup.swift | Removed obsolete file that was initializing DependencyHelperMock in constructor |
| GleanPlumbContextProviderTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| ShortcutsLibraryStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| TopSitesSectionStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| MerinoStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| JumpBackInSectionStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| HomepageStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| BookmarksSectionStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| PrivateHomepageViewControllerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| SearchEngineSelectionStateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| BrowserViewControllerWebViewDelegateTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| FirefoxAccountSignInViewControllerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| DownloadProgressManagerTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| CustomSearchEnginesTest.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| CreditCardSettingsViewControllerTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| LaunchScreenViewModelTests.swift | Updated setUp/tearDown to async but missing await on bootstrapDependencies |
| LaunchTypeTests.swift | Updated setUp/tearDown to async with await for bootstrapDependencies call |
| FormAutofillHelperTests.swift | Added await to bootstrapDependencies call in existing async setUp |
| Client.xcodeproj/project.pbxproj | Removed TestSetup.swift references from build configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift and this method is already async, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile()) | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| DependencyHelperMock().bootstrapDependencies(injectedTabManager: tabManager) |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile()) | ||
| DependencyHelperMock().bootstrapDependencies() |
Copilot
AI
Jan 21, 2026
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.
The call to DependencyHelperMock().bootstrapDependencies() is missing the await keyword. Since this class is annotated with @mainactor and the bootstrapDependencies method is marked as @mainactor in DependencyHelperMock.swift, this call should be awaited to properly handle the async context.
| DependencyHelperMock().bootstrapDependencies() | |
| await DependencyHelperMock().bootstrapDependencies() |
Benchmark PR from qodo-benchmark#226