Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR from qodo-benchmark#226

Copilot AI review requested due to automatic review settings January 21, 2026 19:13
Copy link

Copilot AI left a 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 DependencyHelperMock to use @MainActor annotation and removed Thread.isMainThread logic
  • Updated 59+ test files to use async setUp/tearDown methods with proper await calls
  • Removed obsolete TestSetup.swift file 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()
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
override func setUp() async throws {
try await super.setUp()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile())
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
super.setUp()
override func setUp() async throws {
try await super.setUp()
DependencyHelperMock().bootstrapDependencies(injectedTabManager: tabManager)
Copy link

Copilot AI Jan 21, 2026

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.

Copilot uses AI. Check for mistakes.
override func setUp() async throws {
try await super.setUp()
LegacyFeatureFlagsManager.shared.initializeDeveloperFeatures(with: MockProfile())
DependencyHelperMock().bootstrapDependencies()
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
DependencyHelperMock().bootstrapDependencies()
await DependencyHelperMock().bootstrapDependencies()

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants