Move browser and tmux OSC filter tests into their package test targets

Merged
TE
2mo ago
+10-63

Summary

Work 4 of #15391 (tests move with hot code), continuing #13519 after #15333.

Six suites (68 tests) test only package types but lived in cmuxTests, so a focused verdict on them compiled the app and launched the app host:

suitetestsnow in
BrowserSystemProxyMirrorTests30CmuxBrowserTests
BrowserUserAgentPolicyWebKitTests, BrowserNavigationDecisionHandlerTests10CmuxBrowserTests
BrowserHiddenWebViewDiscardMemoryPressureTests4CmuxBrowserTests
BrowserHTTPBasicAuthPromptCoordinatorTests4CmuxBrowserTests
RemoteTmuxNotificationOSCFilterTests20CmuxRemoteSessionTests

The browser and OSC filter suites are the ones #13787 unblocked. The files move unchanged except that the cmux_DEV/cmux import block is dropped: they use only the packages' public API, and no app file extends the types they test. Both packages already run in swift-package-tests, so no lane change is needed. scripts/sync-test-wiring removed the five files from the cmuxTests target.

How the group was chosen: I mapped every type declared in Sources/ and each package's Sources/, then listed the cmuxTests files that name no app type, no helper declared in another cmuxTests file, and no app-lifecycle API. 22 files (148 tests) qualify. CmuxBrowser is the most-edited package among them (215 Swift file edits in the last 30 days, 2.1% of app Swift edits).

Measurements

Filled in from CI before this leaves draft:

  • focused verdict before (app-host run on the base commit): pending
  • focused verdict after (swift-package-tests for the two packages): pending
  • app target compiled / app host launched: before yes / yes, after no / no
  • edit share now behind the package boundary with its tests: CmuxBrowser 2.1% + CmuxRemoteSession 0.4% of app Swift edits (30 days)

Testing

scripts/sync-test-wiring --check, scripts/check-pbxproj.sh and scripts/check-workspace-package-groups.py pass. No local swift test (no builds on this machine). swift-package-tests in this PR's CI compiles the moved files under the test targets' Swift 6 settings and runs them.

Changelog

none

— Maple g1 🦋 Run: run_worker_20260928_d8cdb384

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Moves the browser and tmux OSC filter test suites out of the app's cmuxTests target into the CmuxBrowser and CmuxRemoteSession package test targets, so focused verdicts on them no longer compile the app or launch the app host.

  • The six suites (68 tests) use only package public API, so the files moved unchanged except for dropping the cmux import block and the blank line it left behind.
  • Both packages already run in swift-package-tests, so no CI lane change is needed; scripts/sync-test-wiring dropped the five files from cmuxTests.
  • Removed the moved suites from cmux-unit-test-timings.json and the app shard tests so shard metadata stays aligned with where the suites now run.
  • PaneResizeShortcutTests and SurfacePaneFactoryFocusTests now install deterministic Bonsplit geometry before creating splits, so they no longer depend on a hidden test window having laid out on cold runners.

Summary by CodeRabbit

  • Tests
    • Added test coverage for browser fixture interactions and pending-request scenarios.
    • Updated test-suite selection and tracking; several suites are no longer included in the test configuration.
    • Made pane resize and focus test setup use fixed container dimensions for more consistent results.