test: restore main's cmuxTests and cmuxCLITests compile

Closed
LA
2mo ago
+171-42

Summary

main's test targets do not compile, and the separate fixes deadlock now that ci-status is required again: each fix fails compile on the breaks the others repair. This PR restores cmuxTests and cmuxCLITests compile in one change.

  1. #15381 (https://github.com/manaflow-ai/cmux/pull/15381) left cmuxTests calling helpers whose signatures changed (LastSurfaceClosePreferenceTests, WorkspaceCloseTabsContextMenuTests: "argument passed to call that takes no arguments"; PaneResizeShortcutTests: "cannot find 'controller'"; CLIVMTransferTests: no CMUXCLI.vmReadyPollInterval). Austin's commits from #16245 fix these. #16245 moved the poll-interval check into cmuxCLITests with @testable import cmux_cli, and Leo added boundary cases.

  2. #16158 (https://github.com/manaflow-ai/cmux/pull/16158) put a mutating call inside #expect, which the macOS 15 toolchain rejects. The #16283 commit calls it outside the macro.

  3. #16196 (https://github.com/manaflow-ai/cmux/pull/16196) added ClaudeHookSessionStoreRecoveryTests with @testable import cmux_cli, and cmuxCLITests stopped compiling ("Unable to find module dependency: 'CmuxControlSocketAtomicsC' / 'CmuxSimulatorSystem'"). cmux_cli is the cmux-cli executable. cmuxCLITests does not link it and cannot be hosted by it, so adding those packages would only move the failure to link time. The two tests keep #16196's coverage, now by running the bundled CLI the way the rest of cmuxCLITests does: they seed the hook state file, run a real cmux hooks claude session-start against a mock socket, and check what is on disk.

    • A malformed sibling record no longer discards a valid session mapping, and a salvageable file is not quarantined.
    • Each of two unreadable state files moves to its own quarantine backup with its original bytes, and the store keeps working afterwards.

    The vm poll-interval test from #16245 had the same cmux_cli import problem. The pure policy now lives in CLI/VMReadyPollInterval.swift, compiled into both the CLI and cmuxCLITests (the CMUXCLI+AutoNaming precedent), and CMUXCLI.vmReadyPollInterval delegates to it.

Credit: Austin Wang (#16245), Leo (#16245 boundary tests, #16196 recovery behavior), and #16283. Their commits are merged here with authorship kept.

Testing

This PR's CI compiles the app, CLI, cmuxTests and cmuxCLITests, and runs the CLI product tests. I did not run them locally.

Changelog

none

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • VM readiness polling now defaults to 3 seconds and accepts valid polling interval overrides from 0.01 to 3 seconds. Invalid, missing, or out-of-range values use the default.
  • Tests
    • Expanded coverage for session recovery with malformed stored data, including valid-session preservation and recovery backup retention.
    • Updated checks for VM polling, workspace projection limits, pane resizing, and tab management.