Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
177
apps/macos/Tests/OpenClawIPCTests/CLIInstallerTests.swift
Normal file
177
apps/macos/Tests/OpenClawIPCTests/CLIInstallerTests.swift
Normal file
@@ -0,0 +1,177 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import OpenClaw
|
||||
|
||||
@Suite(.serialized)
|
||||
@MainActor
|
||||
struct CLIInstallerTests {
|
||||
@Test func `installed location finds executable`() throws {
|
||||
let fm = FileManager()
|
||||
let root = fm.temporaryDirectory.appendingPathComponent(
|
||||
"openclaw-cli-installer-\(UUID().uuidString)")
|
||||
defer { try? fm.removeItem(at: root) }
|
||||
|
||||
let binDir = root.appendingPathComponent("bin")
|
||||
try fm.createDirectory(at: binDir, withIntermediateDirectories: true)
|
||||
let cli = binDir.appendingPathComponent("openclaw")
|
||||
fm.createFile(atPath: cli.path, contents: Data())
|
||||
try fm.setAttributes([.posixPermissions: 0o755], ofItemAtPath: cli.path)
|
||||
|
||||
let found = CLIInstaller.installedLocation(
|
||||
searchPaths: [binDir.path],
|
||||
fileManager: fm)
|
||||
#expect(found == cli.path)
|
||||
|
||||
try fm.removeItem(at: cli)
|
||||
fm.createFile(atPath: cli.path, contents: Data())
|
||||
try fm.setAttributes([.posixPermissions: 0o644], ofItemAtPath: cli.path)
|
||||
|
||||
let missing = CLIInstaller.installedLocation(
|
||||
searchPaths: [binDir.path],
|
||||
fileManager: fm)
|
||||
#expect(missing == nil)
|
||||
}
|
||||
|
||||
@Test func `installer command runs the signed bundled script without a shell pipeline`() {
|
||||
let command = CLIInstaller.installScriptCommand(
|
||||
version: "2026.7.3-beta.1",
|
||||
prefix: "/Users/Test User/.openclaw",
|
||||
scriptPath: "/Applications/OpenClaw.app/Contents/Resources/install-cli.sh")
|
||||
|
||||
#expect(command == [
|
||||
"/bin/bash",
|
||||
"/Applications/OpenClaw.app/Contents/Resources/install-cli.sh",
|
||||
"--json",
|
||||
"--no-onboard",
|
||||
"--prefix",
|
||||
"/Users/Test User/.openclaw",
|
||||
"--version",
|
||||
"2026.7.3-beta.1",
|
||||
])
|
||||
#expect(!command.contains("curl"))
|
||||
}
|
||||
|
||||
@Test func `managed setup requires a parseable compatible version`() {
|
||||
let location = "/Users/test/.openclaw/bin/openclaw"
|
||||
|
||||
#expect(CLIInstaller.classifyVersion(
|
||||
location: location,
|
||||
output: "OpenClaw 2026.7.3\n",
|
||||
expectedVersion: "2026.7.3") == .ready(location: location, version: "2026.7.3"))
|
||||
#expect(CLIInstaller.classifyVersion(
|
||||
location: location,
|
||||
output: "OpenClaw\n",
|
||||
expectedVersion: "2026.7.3") == .unusable(location: location))
|
||||
#expect(CLIInstaller.classifyVersion(
|
||||
location: location,
|
||||
output: "2026.6.1\n",
|
||||
expectedVersion: "2026.7.3") == .incompatible(
|
||||
location: location,
|
||||
found: "2026.6.1",
|
||||
required: "2026.7.3"))
|
||||
}
|
||||
|
||||
@Test func `compatible external CLI satisfies setup`() async throws {
|
||||
let root = FileManager().temporaryDirectory.appendingPathComponent(
|
||||
"openclaw-compatible-cli-\(UUID().uuidString)")
|
||||
defer { try? FileManager().removeItem(at: root) }
|
||||
try FileManager().createDirectory(at: root, withIntermediateDirectories: true)
|
||||
let executable = root.appendingPathComponent("openclaw")
|
||||
try "#!/bin/sh\necho 'OpenClaw 2026.7.3'\n".write(
|
||||
to: executable,
|
||||
atomically: true,
|
||||
encoding: .utf8)
|
||||
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: executable.path)
|
||||
|
||||
let status = await CLIInstaller.status(location: executable.path)
|
||||
|
||||
#expect(status == .ready(location: executable.path, version: "2026.7.3"))
|
||||
}
|
||||
|
||||
@Test func `matching external CLI with unsupported Node is unusable`() async throws {
|
||||
let root = FileManager().temporaryDirectory.appendingPathComponent(
|
||||
"openclaw-old-node-cli-\(UUID().uuidString)")
|
||||
defer { try? FileManager().removeItem(at: root) }
|
||||
try FileManager().createDirectory(at: root, withIntermediateDirectories: true)
|
||||
let executable = root.appendingPathComponent("openclaw")
|
||||
let node = root.appendingPathComponent("node")
|
||||
try "#!/bin/sh\necho 'OpenClaw 2026.7.3'\n".write(
|
||||
to: executable,
|
||||
atomically: true,
|
||||
encoding: .utf8)
|
||||
try "#!/bin/sh\necho 'v20.18.0'\n".write(
|
||||
to: node,
|
||||
atomically: true,
|
||||
encoding: .utf8)
|
||||
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: executable.path)
|
||||
try FileManager().setAttributes([.posixPermissions: 0o755], ofItemAtPath: node.path)
|
||||
|
||||
let status = await CLIInstaller.status(location: executable.path)
|
||||
|
||||
#expect(status == .unusable(location: executable.path))
|
||||
}
|
||||
|
||||
@Test func `CLI probe preserves environment and resolves shebang tools beside executable`() {
|
||||
let location = "/custom/bin/openclaw"
|
||||
let environment = CLIInstaller.probeEnvironment(
|
||||
location: location,
|
||||
processEnvironment: ["HOME": "/Users/test", "PATH": "/usr/bin"],
|
||||
preferredPaths: ["/opt/homebrew/bin", "/usr/bin"])
|
||||
|
||||
#expect(environment["HOME"] == "/Users/test")
|
||||
#expect(environment["PATH"] == "/custom/bin:/opt/homebrew/bin:/usr/bin")
|
||||
}
|
||||
|
||||
@Test func `managed CLI probe prefers its private runtime`() {
|
||||
let executable = "/Users/test/.openclaw/bin/openclaw"
|
||||
let environment = CLIInstaller.probeEnvironment(
|
||||
location: executable,
|
||||
processEnvironment: [:],
|
||||
preferredPaths: ["/Users/test/.nvm/versions/node/v20/bin", "/usr/bin"],
|
||||
managedExecutable: executable,
|
||||
managedRuntimeDirectory: "/Users/test/.openclaw/tools/node/bin")
|
||||
|
||||
#expect(environment["PATH"] == [
|
||||
"/Users/test/.openclaw/bin",
|
||||
"/Users/test/.openclaw/tools/node/bin",
|
||||
"/Users/test/.nvm/versions/node/v20/bin",
|
||||
"/usr/bin",
|
||||
].joined(separator: ":"))
|
||||
}
|
||||
|
||||
@Test func `successful CLI setup starts the local gateway and waits for readiness`() async {
|
||||
var didStart = false
|
||||
var didWait = false
|
||||
|
||||
let activation = await CLIInstaller.activateLocalGateway(
|
||||
mode: .local,
|
||||
paused: false,
|
||||
start: { didStart = true },
|
||||
waitUntilReady: {
|
||||
didWait = true
|
||||
return true
|
||||
})
|
||||
|
||||
#expect(didStart)
|
||||
#expect(didWait)
|
||||
#expect(activation == .ready)
|
||||
}
|
||||
|
||||
@Test func `paused CLI setup defers gateway activation`() async {
|
||||
var didStart = false
|
||||
var didWait = false
|
||||
|
||||
let activation = await CLIInstaller.activateLocalGateway(
|
||||
mode: .local,
|
||||
paused: true,
|
||||
start: { didStart = true },
|
||||
waitUntilReady: {
|
||||
didWait = true
|
||||
return true
|
||||
})
|
||||
|
||||
#expect(!didStart)
|
||||
#expect(!didWait)
|
||||
#expect(activation == .deferred)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user