[MOB-4320] Unit tests compilation fixes [reopened]#1128
Open
[MOB-4320] Unit tests compilation fixes [reopened]#1128
Conversation
These files still exist in Firefox upstream (with Swift 6 @mainactor patterns applied) and cover core tab management, search, toolbar state, and JumpBackIn functionality used by Ecosia. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replaces 13 individual file paths with wildcards for Mocks/, DependencyInjection/, and Coordinators/Mocks/ so new mock files are picked up automatically. Directories that also contain test classes are kept as specific paths to avoid duplicating tests into EcosiaTests. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
All 5 files restored from upstream cannot compile against Ecosia's current production APIs (removed inactive tabs, missing mock properties, upstream-only Nimbus features, renamed AppState fields). They were correctly deleted in the original compilation fix and remain deleted. Rename private mock types in EcosiaWebViewModalTests to avoid name conflicts introduced by the Mocks/*.swift wildcard (MockCoordinator, MockNavigationAction, MockFrameInfo → EcosiaWebView-prefixed variants). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This reverts commit d6a710b.
lucaschifino
approved these changes
May 5, 2026
Collaborator
lucaschifino
left a comment
There was a problem hiding this comment.
@d4r1091 I guess you can't review it now that it's been reopened on your name 😅
From my side it's all good (well, I was the one implementing anyway 🙈) - it might be cleaner to merge this if you agree (or make any small adjustments you see) and then continue the work on the next ticket anyway.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MOB-4320
Context
After the v147 Firefox upstream upgrade, unit tests fail to compile. The main root cause is Swift 6 strict concurrency enforcement: in Swift 6, SWIFT_STRICT_CONCURRENCY = minimal (set during the Tuist migration) has no effect — strict concurrency is unconditionally enforced, unlike Swift 5 where it acted as a suppression mechanism.`
A previous partial Swift 6 migration addressed ~30/35 production source files but explicitly deferred test file migration to unblock the v147 upgrade. Additionally, the v147 bulk file replacement overwrote several individually cherry-picked upstream commits that had already fixed Swift 6 warnings in test files (e.g., RustRemoteTabsTests, TestBrowserDB, WebServer.swift closures). Cherry-picking those fixes back was not viable due to source conflicts from the upgrade.
Approach
Investigation
Fix Patterns Applied (aligned with upstream)
The following Swift 6 concurrency patterns were applied consistently across test and mock files:
@MainActoron test classes — for tests interacting with main-actor-isolated APIs@uncheckedSendable — on non-final test/mock classes conforming to Sendable protocols where full conformance isn't feasible@MainActorproperties within synchronous callbacks known to run on the main thread@MainActorproperties before autoclosure — to avoid isolation violations in XCTAssert* callsOther fixes
.xctestplanfile with fully inline test target and skip declarations inSchemes+Ecosia.swiftusing Tuist'sskippedTestsparameter — Tuist resolves target identifiers at generation time, eliminating stale UUID issues that occurred whenever the project was regeneratedNotes
CI: Temporarily disabled Merge Unit Tests
The Merge Unit Tests workflow (.github/workflows/merge_tests.yml) has been temporarily disabled by clearing its trigger branches. Running them as a merge gate at this stage produces noise rather than signal and adds significant overhead (~30+ min) with no actionable feedback.
Fixing issues and re-enabling them has been split into MOB-4384.
Before merging
Checklist
// Ecosia:helper comments where needed