-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor FXIOS-14344 [Swift 6 migration] Fixing DependencyHelperMock unit tests warning #34
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: coderabbit_full_base_refactor_fxios-14344_swift_6_migration_fixing_dependencyhelpermock_unit_tests_warning_pr8
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request systematically converts XCTest setup/teardown lifecycle methods from synchronous to asynchronous throwing variants across 50+ test files, updates DependencyHelperMock with Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
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.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift`:
- Around line 13-17: The setUp() async method is calling
DependencyHelperMock().bootstrapDependencies() without awaiting the async
operation; update the call in setUp() so you await
DependencyHelperMock().bootstrapDependencies() (e.g., await
DependencyHelperMock().bootstrapDependencies()) to satisfy Swift concurrency
rules and avoid compiler warnings/errors — no other changes to setUp() are
required since it is already async.
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/NotificationSurface/NotificationSurfaceManagerTests.swift`:
- Around line 19-23: The tearDown method in NotificationSurfaceManagerTests does
not call DependencyHelperMock().reset(), so bootstrapped dependencies from setUp
may leak into other tests; update override func tearDown() async throws (the
method that currently nils messageManager and notificationManager) to call
DependencyHelperMock().reset() before or after clearing messageManager and
notificationManager and then await try super.tearDown() as in other migrated
tests so dependencies are cleaned up properly.
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorTelemetryTests.swift`:
- Around line 19-22: The tearDown in PasswordGeneratorTelemetryTests does not
call DependencyHelperMock().reset(), leaving test dependencies stale; update the
override func tearDown() async throws in the PasswordGeneratorTelemetryTests
class to call DependencyHelperMock().reset() (or
DependencyHelperMock.shared.reset() if a singleton is used) before or after
nulling gleanWrapper and before calling try await super.tearDown(), ensuring the
test cleanup mirrors other tests' setUp/tearDown pattern.
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/SurveySurface/SurveySurfaceManagerTests.swift`:
- Around line 20-23: The tearDown implementation must call
DependencyHelperMock().reset() to clear bootstrapDependencies modifications and
avoid cross-test contamination; update the SurveySurfaceManagerTests.tearDown to
invoke DependencyHelperMock().reset() (synchronously) before or after setting
messageManager = nil so AppContainer.shared returns to a clean state for
subsequent tests.
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/TrackingProtectionStateTests.swift`:
- Around line 19-22: The tearDown implementation in TrackingProtectionStateTests
is missing a call to DependencyHelperMock().reset(), which other tests use to
clear bootstrapped dependencies; modify override func tearDown() async throws
(the method in this file) to call DependencyHelperMock().reset() (ideally
immediately after try await super.tearDown()) and then set mockProfile = nil so
dependencies are cleaned between tests.
🧹 Nitpick comments (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (1)
9-10: Remove empty line after opening brace.SwiftLint flags an empty line after the opening brace at line 10, which violates the
vertical_whitespace_opening_bracesrule.🧹 Suggested fix
final class DependencyHelperMock { - `@MainActor`firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayPanelTests.swift (1)
15-18: Inconsistent tearDown ordering compared to other test files.In this file,
super.tearDown()is called beforeDependencyHelperMock().reset(), but in other files in this PR (e.g.,RemoteTabPanelTests.swift,SearchEngineSelectionStateTests.swift,MainMenuStateTests.swift), the pattern is reversed—reset()is called first, thensuper.tearDown().The standard convention is to clean up custom resources before invoking the superclass teardown. Consider reordering for consistency:
Proposed fix
override func tearDown() async throws { - try await super.tearDown() DependencyHelperMock().reset() + try await super.tearDown() }firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift (1)
19-22: Inconsistent tearDown ordering.The
reset()call comes aftersuper.tearDown(), which is inconsistent with most other test files in this PR wherereset()is called beforesuper.tearDown(). Standard convention is to clean up custom resources before invoking the superclass teardown.Proposed fix
override func tearDown() async throws { - try await super.tearDown() DependencyHelperMock().reset() + try await super.tearDown() }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (57)
firefox-ios/Client.xcodeproj/project.pbxprojfirefox-ios/firefox-ios-tests/Tests/ClientTests/Autofill/FormAutofillHelperTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/DownloadProgressManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/FirefoxAccountSignInViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserViewControllerWebViewDelegateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEngineSelectionStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/BookmarksSectionStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/HomepageStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/JumpBackInSectionStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/MerinoStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/TopSitesSectionStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/ShortcutsLibrary/Redux/ShortcutsLibraryStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/GleanPlumbContextProviderTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Helpers/TestSetup.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Library/LibraryViewModelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Library/ReadingListPanelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingMessageTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingTriggerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveySurfaceManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/NativeErrorPage/NativeErrorPageViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/NotificationSurface/NotificationSurfaceManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/NotificationSurface/OnboardingNotificationCardHelperTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/OnboardingTelemetryUtilityTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/UpdateViewModelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorTelemetryTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/SearchBarLocationSaverTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Sharing/URLActivityItemProviderTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/SurveySurface/SurveySurfaceManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabEventHandlerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/Redux/TabPeekStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayPanelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabsPanelStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryContextualIdentifierTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Toolbar/AddressToolbarContainerModelTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/BlockedTrackersTableViewControllerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/TrackingProtectionStateTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/Utils/SponsoredContentFilterUtilityTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/WindowManagerTests.swiftfirefox-ios/firefox-ios-tests/Tests/ClientTests/ZoomPageManagerTests.swift
💤 Files with no reviewable changes (1)
- firefox-ios/firefox-ios-tests/Tests/ClientTests/Helpers/TestSetup.swift
🧰 Additional context used
🧬 Code graph analysis (25)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Toolbar/AddressToolbarContainerModelTests.swift (1)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (1)
bootstrapDependencies(11-72)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Sharing/URLActivityItemProviderTests.swift (7)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/BlockedTrackersTableViewControllerTests.swift (2)
setUp(19-22)tearDown(24-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayDiffableDataSourceTests.swift (2)
setUp(14-17)tearDown(19-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/Settings/BrowsingSettingsViewControllerTests.swift (2)
setUp(16-21)tearDown(23-28)firefox-ios/firefox-ios-tests/Tests/ClientTests/Settings/VersionSettingTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Sharing/ShareManagerTests.swift (2)
setUp(20-25)tearDown(27-31)firefox-ios/Client/FeatureFlags/LegacyFeatureFlagsManager.swift (1)
initializeDeveloperFeatures(158-175)firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeMiddlewareTests.swift (1)
tearDown(35-41)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swift (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (1)
setUp(14-17)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (1)
setUp(12-15)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelTests.swift (1)
setUp(12-15)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/HomepageStateTests.swift (11)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/Autofill/FormAutofillHelperTests.swift (2)
setUp(48-77)tearDown(79-89)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift (2)
setUp(14-19)tearDown(21-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/DownloadProgressManagerTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/FirefoxAccountSignInViewControllerTests.swift (2)
setUp(15-20)tearDown(22-25)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/MerinoStateTests.swift (2)
setUp(12-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/TopSitesSectionStateTests.swift (2)
setUp(12-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/SearchBarLocationSaverTests.swift (2)
setUp(14-19)tearDown(21-28)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (2)
bootstrapDependencies(11-72)reset(74-76)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/TrackingProtectionStateTests.swift (16)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (2)
setUp(15-23)tearDown(25-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (2)
setUp(28-42)tearDown(44-51)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserViewControllerWebViewDelegateTests.swift (2)
setUp(21-29)tearDown(31-37)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/BookmarksSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/JumpBackInSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/GleanPlumbContextProviderTests.swift (2)
setUp(15-22)tearDown(24-30)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift (2)
setUp(13-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/LibraryViewModelTests.swift (2)
setUp(13-20)tearDown(22-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/Redux/TabPeekStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swift (2)
setUp(15-18)tearDown(20-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabsPanelStateTests.swift (2)
setUp(12-15)tearDown(17-20)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/ShortcutsLibrary/Redux/ShortcutsLibraryStateTests.swift (5)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/DownloadProgressManagerTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/ShortcutsLibrary/Redux/ShortcutsLibraryDiffableDataSourceTests.swift (2)
setUp(15-25)tearDown(27-32)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (2)
bootstrapDependencies(11-72)reset(74-76)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (6)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (2)
setUp(15-23)tearDown(25-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/UpdateViewModelTests.swift (2)
setUp(16-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchCoordinatorTests.swift (2)
setUp(18-25)tearDown(27-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewControllerTests.swift (2)
setUp(16-24)tearDown(26-33)
firefox-ios/firefox-ios-tests/Tests/ClientTests/NotificationSurface/OnboardingNotificationCardHelperTests.swift (5)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingMessageTests.swift (2)
setUp(13-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchCoordinatorTests.swift (2)
setUp(18-25)tearDown(27-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewControllerTests.swift (2)
setUp(16-24)tearDown(26-33)
firefox-ios/firefox-ios-tests/Tests/ClientTests/ZoomPageManagerTests.swift (16)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (2)
setUp(15-23)tearDown(25-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (2)
setUp(28-42)tearDown(44-51)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserViewControllerWebViewDelegateTests.swift (2)
setUp(21-29)tearDown(31-37)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/BookmarksSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/JumpBackInSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/GleanPlumbContextProviderTests.swift (2)
setUp(15-22)tearDown(24-30)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift (2)
setUp(13-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/LibraryViewModelTests.swift (2)
setUp(13-20)tearDown(22-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/ReadingListPanelTests.swift (2)
setUp(12-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingMessageTests.swift (2)
setUp(13-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveySurfaceManagerTests.swift (2)
setUp(12-16)tearDown(18-22)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyStateTests.swift (6)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (1)
setUp(15-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (1)
setUp(14-17)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (1)
setUp(12-15)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swift (1)
setUp(11-14)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/Redux/TabPeekStateTests.swift (1)
setUp(11-14)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swift (1)
setUp(15-18)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabEventHandlerTests.swift (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (2)
setUp(28-42)tearDown(44-51)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)
firefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/OnboardingTelemetryUtilityTests.swift (9)
firefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorTelemetryTests.swift (2)
setUp(13-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryContextualIdentifierTests.swift (2)
setUp(11-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/BrowserViewControllerTests.swift (2)
setUp(25-38)tearDown(40-49)firefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/OnboardingTelemetryDelegationTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEnginesManagerTests.swift (2)
setUp(20-31)tearDown(33-38)firefox-ios/firefox-ios-tests/Tests/ClientTests/Sharing/ShareTelemetryTests.swift (2)
setUp(23-26)tearDown(28-31)firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryWrapperTests.swift (2)
setUp(17-23)tearDown(25-30)firefox-ios/firefox-ios-tests/Tests/ClientTests/WebviewTelemetryTests.swift (2)
setUp(13-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (2)
bootstrapDependencies(11-72)reset(74-76)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (2)
setUp(15-23)tearDown(25-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/BrowserViewControllerStateTests.swift (2)
setUp(14-18)tearDown(20-24)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabWebViewTests.swift (2)
setUp(18-24)tearDown(26-31)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserWebUIDelegateTests.swift (2)
setUp(24-31)tearDown(33-38)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/BookmarksMiddlewareTests.swift (2)
setUp(14-19)tearDown(21-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/HomepageViewControllerTests.swift (2)
setUp(17-22)tearDown(24-31)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (7)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/WindowManagerTests.swift (2)
setUp(16-19)tearDown(21-24)firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeMiddlewareTests.swift (2)
setUp(19-33)tearDown(35-41)firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift (3)
tabManager(4637-4780)tabManager(4804-4815)tabManager(4817-4825)firefox-ios/Client/Frontend/Browser/Tabs/Middleware/TabManagerMiddleware.swift (1)
tabManager(641-649)firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift (1)
tabManager(544-546)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/BlockedTrackersTableViewControllerTests.swift (10)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (2)
setUp(28-42)tearDown(44-51)firefox-ios/firefox-ios-tests/Tests/ClientTests/StatusBarOverlayTests.swift (2)
setUp(20-26)tearDown(28-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayDiffableDataSourceTests.swift (2)
setUp(14-17)tearDown(19-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/Settings/ThemeSettingsControllerTests.swift (2)
setUp(16-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Settings/VersionSettingTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabsMiddlewareTests.swift (2)
setUp(16-21)tearDown(23-28)firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeMiddlewareTests.swift (2)
setUp(19-33)tearDown(35-41)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTests.swift (2)
setUp(21-30)tearDown(32-40)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabWebViewTests.swift (2)
setUp(18-24)tearDown(26-31)firefox-ios/firefox-ios-tests/Tests/ClientTests/TemporaryDocumentTests.swift (1)
tearDown(27-34)
firefox-ios/firefox-ios-tests/Tests/ClientTests/FirefoxAccountSignInViewControllerTests.swift (17)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserViewControllerWebViewDelegateTests.swift (2)
setUp(21-29)tearDown(31-37)firefox-ios/firefox-ios-tests/Tests/ClientTests/Autofill/FormAutofillHelperTests.swift (2)
setUp(48-77)tearDown(79-89)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift (2)
setUp(14-19)tearDown(21-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/DownloadProgressManagerTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEngineSelectionStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEnginesManagerTests.swift (2)
setUp(20-31)tearDown(33-38)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/TabScrollHandlerTests.swift (2)
setUp(24-32)tearDown(34-41)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/RemoteTabsPanelTests.swift (2)
setUp(19-23)tearDown(25-29)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEngineSelectionMiddlewareTests.swift (2)
setUp(22-31)tearDown(33-37)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/LegacyTabScrollControllerTests.swift (2)
setUp(23-31)tearDown(33-38)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/ToolbarAnimatorTest.swift (2)
setUp(20-27)tearDown(29-34)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEngineSelectionViewControllerTests.swift (2)
setUp(15-19)tearDown(21-24)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/TopSitesHelperTests.swift (2)
setUp(29-34)tearDown(23-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (2)
bootstrapDependencies(11-72)reset(74-76)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DownloadProgressManagerTests.swift (12)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/Autofill/FormAutofillHelperTests.swift (2)
setUp(48-77)tearDown(79-89)firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/SearchEngines/SearchEngineSelectionStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/HomepageStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/TopSitesSectionStateTests.swift (2)
setUp(12-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingTriggerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/SearchBarLocationSaverTests.swift (2)
setUp(14-19)tearDown(21-28)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayPanelTests.swift (2)
setUp(10-13)tearDown(15-18)firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryContextualIdentifierTests.swift (2)
setUp(11-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (2)
bootstrapDependencies(11-72)reset(74-76)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Autofill/FormAutofillHelperTests.swift (1)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (1)
bootstrapDependencies(11-72)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryContextualIdentifierTests.swift (3)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/LaunchView/LaunchScreenViewModelTests.swift (2)
setUp(17-26)tearDown(28-35)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (1)
bootstrapDependencies(11-72)
firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/Redux/TabPeekStateTests.swift (16)
firefox-ios/firefox-ios-tests/Tests/ClientTests/StartAtHome/StartAtHomeHelperTests.swift (2)
setUp(15-23)tearDown(25-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabManagement/TabManagerTests.swift (2)
setUp(28-42)tearDown(44-51)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Browser/BrowserViewControllerWebViewDelegateTests.swift (2)
setUp(21-29)tearDown(31-37)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/BookmarksSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/JumpBackInSectionStateTests.swift (2)
setUp(15-20)tearDown(22-26)firefox-ios/firefox-ios-tests/Tests/ClientTests/GleanPlumbContextProviderTests.swift (2)
setUp(15-22)tearDown(24-30)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift (2)
setUp(13-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/LibraryViewModelTests.swift (2)
setUp(13-20)tearDown(22-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorStateTests.swift (2)
setUp(11-14)tearDown(16-19)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swift (2)
setUp(15-18)tearDown(20-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabsPanelStateTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/TrackingProtectionStateTests.swift (2)
setUp(13-17)tearDown(19-22)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingMessageTests.swift (4)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/Launch/LaunchTypeTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/CustomSearchEnginesTest.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingTriggerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/ReaderModeStyleTests.swift (2)
setUp(14-18)tearDown(20-24)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyViewControllerTests.swift (13)
firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/NativeErrorPage/NativeErrorPageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/StoriesFeed/StoriesFeedDiffableDataSourceTests.swift (2)
setUp(16-26)tearDown(28-33)firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/SyncContentSettingsViewControllerTests.swift (2)
setUp(15-22)tearDown(24-29)firefox-ios/firefox-ios-tests/Tests/ClientTests/FxAWebViewModelTests.swift (2)
setUp(14-21)tearDown(23-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/Helpers/NotificationManagerTests.swift (2)
setUp(12-17)tearDown(19-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/Helpers/RatingPromptManagerTests.swift (2)
setUp(22-34)tearDown(36-47)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuCoordinatorTests.swift (2)
setUp(14-18)tearDown(20-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuConfigurationUtilityTests.swift (2)
setUp(17-21)tearDown(23-27)firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/Bookmarks/EditBookmarkViewModelTests.swift (2)
setUp(34-39)tearDown(41-46)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyCoordinatorTests.swift (2)
setUp(15-20)tearDown(22-25)firefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/IntroViewControllerTests.swift (2)
setUp(14-18)tearDown(20-23)firefox-ios/firefox-ios-tests/Tests/ClientTests/OnboardingTests/IntroViewModelTests.swift (2)
setUp(16-20)tearDown(22-25)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/Redux/JumpBackInSectionStateTests.swift (5)
firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage/PrivateHomepageViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuStateTests.swift (2)
setUp(12-15)tearDown(17-20)firefox-ios/firefox-ios-tests/Tests/ClientTests/MainMenu/MainMenuViewControllerTests.swift (2)
setUp(14-17)tearDown(19-22)firefox-ios/firefox-ios-tests/Tests/ClientTests/Messaging/NimbusMessagingMessageTests.swift (2)
setUp(13-16)tearDown(18-21)firefox-ios/firefox-ios-tests/Tests/ClientTests/Microsurvey/MicrosurveyPromptStateTests.swift (2)
setUp(11-14)tearDown(16-19)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift (4)
firefox-ios/Client/Frontend/Browser/Tabs/Middleware/TabManagerMiddleware.swift (1)
tabManager(641-649)firefox-ios/Client/Application/WindowManager.swift (1)
tabManager(138-160)firefox-ios/Client/Frontend/Browser/TopTabDisplayManager.swift (2)
tabManager(608-626)tabManager(649-661)firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift (1)
tabManager(544-546)
🪛 SwiftLint (0.57.0)
firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swift
[Warning] 10-10: Don't include vertical whitespace (empty line) after opening braces
(vertical_whitespace_opening_braces)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| override func setUp() async throws { | ||
| try await super.setUp() | ||
| LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile()) | ||
| DependencyHelperMock().bootstrapDependencies() | ||
| } |
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.
Missing await on bootstrapDependencies() call.
The bootstrapDependencies() method is async (as shown in other files in this PR where it's awaited), but here it's called without await. This will result in a compiler warning or error in Swift 6's strict concurrency mode.
Proposed fix
override func setUp() async throws {
try await super.setUp()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile())
- DependencyHelperMock().bootstrapDependencies()
+ await DependencyHelperMock().bootstrapDependencies()
}🤖 Prompt for AI Agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/Library/DownloadsPanelTests.swift`
around lines 13 - 17, The setUp() async method is calling
DependencyHelperMock().bootstrapDependencies() without awaiting the async
operation; update the call in setUp() so you await
DependencyHelperMock().bootstrapDependencies() (e.g., await
DependencyHelperMock().bootstrapDependencies()) to satisfy Swift concurrency
rules and avoid compiler warnings/errors — no other changes to setUp() are
required since it is already async.
| override func tearDown() async throws { | ||
| try await super.tearDown() | ||
| messageManager = nil | ||
| notificationManager = nil | ||
| } |
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.
Missing DependencyHelperMock().reset() call in tearDown.
Other migrated test files (e.g., MainMenuStateTests, MicrosurveySurfaceManagerTests, OnboardingTelemetryUtilityTests) call DependencyHelperMock().reset() in tearDown to clean up bootstrapped dependencies. This file bootstraps dependencies in setUp but does not reset them, which could cause test pollution.
Proposed fix
override func tearDown() async throws {
- try await super.tearDown()
+ DependencyHelperMock().reset()
messageManager = nil
notificationManager = nil
+ try await super.tearDown()
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| override func tearDown() async throws { | |
| try await super.tearDown() | |
| messageManager = nil | |
| notificationManager = nil | |
| } | |
| override func tearDown() async throws { | |
| DependencyHelperMock().reset() | |
| messageManager = nil | |
| notificationManager = nil | |
| try await super.tearDown() | |
| } |
🤖 Prompt for AI Agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/NotificationSurface/NotificationSurfaceManagerTests.swift`
around lines 19 - 23, The tearDown method in NotificationSurfaceManagerTests
does not call DependencyHelperMock().reset(), so bootstrapped dependencies from
setUp may leak into other tests; update override func tearDown() async throws
(the method that currently nils messageManager and notificationManager) to call
DependencyHelperMock().reset() before or after clearing messageManager and
notificationManager and then await try super.tearDown() as in other migrated
tests so dependencies are cleaned up properly.
| override func tearDown() async throws { | ||
| gleanWrapper = nil | ||
| super.tearDown() | ||
| try await super.tearDown() | ||
| } |
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.
Missing DependencyHelperMock().reset() call in tearDown.
The tearDown method bootstraps dependencies in setUp but does not call DependencyHelperMock().reset() to clean them up. This is inconsistent with all other test files in this PR (e.g., TabManagerTests, ShortcutsLibraryStateTests, TabEventHandlerTests) and could leave dependencies in a stale state between tests.
🔧 Proposed fix
override func tearDown() async throws {
gleanWrapper = nil
+ DependencyHelperMock().reset()
try await super.tearDown()
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| override func tearDown() async throws { | |
| gleanWrapper = nil | |
| super.tearDown() | |
| try await super.tearDown() | |
| } | |
| override func tearDown() async throws { | |
| gleanWrapper = nil | |
| DependencyHelperMock().reset() | |
| try await super.tearDown() | |
| } |
🤖 Prompt for AI Agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/PasswordGenerator/PasswordGeneratorTelemetryTests.swift`
around lines 19 - 22, The tearDown in PasswordGeneratorTelemetryTests does not
call DependencyHelperMock().reset(), leaving test dependencies stale; update the
override func tearDown() async throws in the PasswordGeneratorTelemetryTests
class to call DependencyHelperMock().reset() (or
DependencyHelperMock.shared.reset() if a singleton is used) before or after
nulling gleanWrapper and before calling try await super.tearDown(), ensuring the
test cleanup mirrors other tests' setUp/tearDown pattern.
| override func tearDown() async throws { | ||
| try await super.tearDown() | ||
| messageManager = nil | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's find and check the DependencyHelperMock file
fd 'DependencyHelperMock\.swift' -aRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 203
🏁 Script executed:
# Also check the test file to understand the full setUp/tearDown pattern
fd 'SurveySurfaceManagerTests\.swift' -aRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 202
🏁 Script executed:
# Search for DependencyHelperMock across the codebase to understand its usage
rg -l 'DependencyHelperMock' --type swiftRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 13695
🏁 Script executed:
cat -n /home/jailuser/git/firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swiftRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 3705
🏁 Script executed:
cat -n /home/jailuser/git/firefox-ios/firefox-ios-tests/Tests/ClientTests/SurveySurface/SurveySurfaceManagerTests.swiftRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 6876
🏁 Script executed:
# Check if AppContainer.shared.reset() is being called in bootstrapDependencies
# and verify the execution order
rg -n "AppContainer\.shared\.reset|bootstrapDependencies" firefox-ios/firefox-ios-tests/Tests/ClientTests/DependencyInjection/DependencyHelperMock.swiftRepository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 202
🏁 Script executed:
# Check other test files to see if they call reset() in tearDown after calling bootstrapDependencies
rg -l "bootstrapDependencies" firefox-ios/firefox-ios-tests/Tests/ClientTests/ | head -5 | xargs -I {} sh -c 'echo "=== {} ===" && rg -A 5 "tearDown" {}'Repository: qodo-benchmark/firefox-ios-combined-coderabbit
Length of output: 1591
Call DependencyHelperMock().reset() in tearDown to prevent cross-test contamination.
bootstrapDependencies() is called in setUp, but dependencies are not reset in tearDown. This leaves AppContainer.shared in a modified state, potentially causing flaky tests. Other test files using DependencyHelperMock follow the pattern of calling reset() in tearDown (e.g., ZoomPageManagerTests, WindowManagerTests). The reset() method is synchronous, so no await is needed.
Suggested fix
override func tearDown() async throws {
try await super.tearDown()
messageManager = nil
+ DependencyHelperMock().reset()
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| override func tearDown() async throws { | |
| try await super.tearDown() | |
| messageManager = nil | |
| } | |
| override func tearDown() async throws { | |
| try await super.tearDown() | |
| messageManager = nil | |
| DependencyHelperMock().reset() | |
| } |
🤖 Prompt for AI Agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/SurveySurface/SurveySurfaceManagerTests.swift`
around lines 20 - 23, The tearDown implementation must call
DependencyHelperMock().reset() to clear bootstrapDependencies modifications and
avoid cross-test contamination; update the SurveySurfaceManagerTests.tearDown to
invoke DependencyHelperMock().reset() (synchronously) before or after setting
messageManager = nil so AppContainer.shared returns to a clean state for
subsequent tests.
| override func tearDown() async throws { | ||
| try await super.tearDown() | ||
| mockProfile = nil | ||
| } |
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.
Missing DependencyHelperMock().reset() call in tearDown.
Other test files in this PR (e.g., MainMenuStateTests, MicrosurveyPromptStateTests, TabsPanelStateTests) call DependencyHelperMock().reset() in tearDown to clean up bootstrapped dependencies. This file is missing that call, which could lead to test pollution.
Proposed fix
override func tearDown() async throws {
- try await super.tearDown()
+ DependencyHelperMock().reset()
mockProfile = nil
+ try await super.tearDown()
}🤖 Prompt for AI Agents
In
`@firefox-ios/firefox-ios-tests/Tests/ClientTests/TrackingProtectionTests/TrackingProtectionStateTests.swift`
around lines 19 - 22, The tearDown implementation in
TrackingProtectionStateTests is missing a call to
DependencyHelperMock().reset(), which other tests use to clear bootstrapped
dependencies; modify override func tearDown() async throws (the method in this
file) to call DependencyHelperMock().reset() (ideally immediately after try
await super.tearDown()) and then set mockProfile = nil so dependencies are
cleaned between tests.
Benchmark PR from agentic-review-benchmarks#8
Summary by CodeRabbit
Tests
Chores
@MainActorannotation and expanded parameters.✏️ Tip: You can customize this high-level summary in your review settings.