Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Packages/macOS/CmuxCloud/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ let package = Package(
.package(path: "../CmuxMobileHost"),
.package(path: "../CmuxPhonePush"),
.package(path: "../CmuxSettings"),
.package(path: "../CmuxSurfaceCatalogModel")
.package(path: "../CmuxSurfaceCatalogModel"),
.package(path: "../CmuxTerminal")
],
targets: [
.target(
Expand Down Expand Up @@ -49,7 +50,19 @@ let package = Package(
),
.testTarget(
name: "CmuxCloudTests",
dependencies: ["CmuxCloud"]
dependencies: [
"CmuxCloud",
"CmuxAuthRuntime",
"CmuxCloudTui",
"CmuxCloudTunnelCore",
"CMUXMobileCore",
"CmuxPhonePush",
"CmuxSurfaceCatalogModel",
// CmuxTerminal binds libghostty, which SwiftPM cannot link here.
.product(name: "CmuxTerminalGhosttyRuntimeTestStubs", package: "CmuxTerminal")
],
// Most of these tests moved from the app's test target, which builds in Swift 5 mode.
swiftSettings: [.swiftLanguageMode(.v5)]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxCloudTui
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// A refresh pass must never tear down a working attachment because the
/// resolution lookup, which rides the same link, could not answer.
@Suite("Cloud attachment reconcile decision")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxCloudTui
import Foundation
import Testing
#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The env delivery protocol's pure half: what is typed into `cmux env receive`, how it
/// is chunked, and how the receiver's verdict is read back. The shim's side of the same
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing
#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The file delivery protocol's pure half (`cmux vm push --secret` → `vm.file_put` →
/// the in-VM `cmux file receive`): the receiver argv, what is typed into its PTY, the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxSurfaceCatalogModel
import Foundation
import Testing
#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The pure half of cloud-machine notifications: what the Mac accepts off a machine's
/// `session current events --jsonl` stream, how it bounds and cleans it, how it rate-limits
Expand Down Expand Up @@ -338,7 +333,6 @@ import Testing
SurfaceProjection(resource: SurfaceResourceID(machine: machine, kind: kind, key: key), workspaceID: workspace, panelID: panel)
}


private static func notificationRow(terminalID: String?) -> CloudVMNotificationRow {
CloudVMNotificationRow(
id: notificationID, title: "Ready", subtitle: nil, body: "", level: "info",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@MainActor
@Suite("Cloud notification persistence")
struct CloudNotificationSyncStoreTests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxSurfaceCatalogModel
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@MainActor
struct CloudProviderRefreshCoordinatorTests {
@Test("Panel refreshes coalesce per machine while separate machines remain independent")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import CmuxCloudTui
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif
@testable import CmuxCloud

/// Viewer themes and terminal-authored OSC state have separate ownership.
@Suite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxCloudTui
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@Suite("Cloud terminal creation request")
@MainActor
struct CloudTerminalCreationRequestTests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing
#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// A cloud pane owns no process, so nothing local notices when its remote
/// shell exits. The graph is the signal, and these are the rules that turn a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// Backend selection makes unentitled builds fail closed: every missing piece
/// must name itself, and only a build with the
/// signed capability, the install entitlement, and a bundled extension may
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The coordinator's state/link fan-out must not accumulate subscribers that
/// left between yields: `cmux vpn status` polls subscribe and go away without
/// the state ever changing. The owner learns of each departure through the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import CmuxCloudTunnelCore
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif
@testable import CmuxCloud

/// The runtime configuration the extension hands the app must carry peers and
/// counters but never key material.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// Nothing the app opens depends on the system-wide VPN (Ports, Desktop, and
/// terminals ride the user-space hub), so an idle tunnel must not be reported
/// as something blocking the user; only an in-flight `cmux vpn up` is.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import CmuxSurfaceCatalogModel
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@MainActor
@Suite("Cloud workspace projection reconciliation")
struct CloudWorkspaceProjectionPlanTests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The address arithmetic behind "does this Cloud VM route need the WireGuard hub".
@Suite
struct IPNetworkPrefixTests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import CmuxCloud
@testable import CmuxCloud
import CmuxAuthRuntime
import CmuxPhonePush
import Darwin
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@Suite struct PhonePushSerialDeliveryQueueTests {
@MainActor
@Test func inFlightOlderEventCannotCompleteAfterNewerEvent() async throws {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing
import CMUXMobileCore

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// Tests the pure request-shaping for `cmux remotes`: host:port parsing, the
/// loopback refusal (a phone could never dial a localhost remote), deterministic
/// name → deviceId idempotency, and the stored-route display parsing that
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The byte-level contract with the cmux-tui hub's SOCKS5 subset: CONNECT to a
/// literal IP with no authentication, and a reply whose bound address must be
/// drained before the tunneled bytes begin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV

@Suite
struct VMClientTelemetryTests {
private func record(
Expand Down Expand Up @@ -178,4 +175,3 @@ private final class CaptureLog: @unchecked Sendable {
var sentry: [(String, VMRequestFailureSeverity)] = []
var breadcrumbs = 0
}
#endif
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing
#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

@MainActor
@Suite("Resource readings across resize and poll races")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import CmuxCloud
@testable import CmuxCloud
import CryptoKit
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The local half of Cloud VM private networking: keys and device identity are
/// minted once and stay stable, and the server-issued config (blank
/// `PrivateKey`) is completed on this Mac without ever sending the key out.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import CmuxCloud
@testable import CmuxCloud
import Foundation
import Testing

#if canImport(cmux_DEV)
@testable import cmux_DEV
#elseif canImport(cmux)
@testable import cmux
#endif

/// The remaining config-scope rules shared by the user-space and Network
/// Extension WireGuard implementations.
@Suite("VM tunnel config scope")
Expand Down
Loading
Loading