From 4ef86b149d47bc15c6e9b5c0a14c2e4ab4f11be0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Jul 2026 18:58:39 +0100 Subject: [PATCH] test(apple): isolate OpenClawKit CI builds (#110088) --- .github/workflows/ci.yml | 9 ++++++++- .../OpenClawKitTests/GatewayErrorsTests.swift | 15 +++++++++++---- .../OpenClawKitTests/WatchCommandsTests.swift | 3 ++- docs/ci.md | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e982116719bd..628c33aa8684 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2935,7 +2935,14 @@ jobs: swift build --package-path apps/shared/OpenClawKit --target OpenClawKit --disable-default-traits - name: OpenClawKit tests - run: swift test --package-path apps/shared/OpenClawKit --parallel + run: | + set -euo pipefail + openclawkit_scratch="$(mktemp -d "$RUNNER_TEMP/openclawkit.XXXXXX")" + trap 'rm -rf "$openclawkit_scratch"' EXIT + swift test \ + --package-path apps/shared/OpenClawKit \ + --scratch-path "$openclawkit_scratch" \ + --parallel - name: Swift test run: | diff --git a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift index 906bbe559a26..ccdddd06db5b 100644 --- a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift +++ b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift @@ -56,10 +56,10 @@ struct GatewayErrorsTests { let problem = try #require(GatewayConnectionProblemMapper.map(error: error)) - #expect(problem.titlePresentation == .localized("This device is not approved yet")) - #expect(problem.messagePresentation == .localized( - "The gateway received the connection request, but this device must be approved first.")) - #expect(problem.actionLabelPresentation == .localized("Approve on gateway")) + #expect(problem.titlePresentation.localizationKey == "This device is not approved yet") + #expect(problem.messagePresentation + .localizationKey == "The gateway received the connection request, but this device must be approved first.") + #expect(problem.actionLabelPresentation?.localizationKey == "Approve on gateway") } @Test func `gateway supplied copy remains verbatim`() throws { @@ -282,3 +282,10 @@ struct GatewayErrorsTests { #expect(problem?.canTrustRotatedCertificate == false) } } + +extension GatewayConnectionProblem.PresentationText { + fileprivate var localizationKey: String? { + guard case let .localized(key) = self else { return nil } + return key + } +} diff --git a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/WatchCommandsTests.swift b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/WatchCommandsTests.swift index b188c95a2a47..1f84fe930dbb 100644 --- a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/WatchCommandsTests.swift +++ b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/WatchCommandsTests.swift @@ -1,6 +1,6 @@ import Foundation -@testable import OpenClawKit import Testing +@testable import OpenClawKit struct WatchCommandsTests { @Test func `app snapshot dual writes semantic and legacy status fields`() throws { @@ -22,6 +22,7 @@ struct WatchCommandsTests { let encoded = try JSONEncoder().encode(message) let object = try #require(JSONSerialization.jsonObject(with: encoded) as? [String: Any]) + #expect(object["type"] as? String == "watch.app.snapshot") #expect(object["gatewayStatus"] != nil) #expect(object["gatewayStatusText"] as? String == "Connected") #expect(object["talkStatus"] != nil) diff --git a/docs/ci.md b/docs/ci.md index 706f68989c1b..f4c505971bb0 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -46,7 +46,7 @@ dispatch. | `skills-python` | Ruff + pytest for Python-backed skills | Python-skill-relevant changes | | `checks-windows` | Windows-specific process/path tests plus shared runtime import specifier regressions | Windows-relevant changes | | `macos-node` | Focused macOS TypeScript tests: launchd, Homebrew, runtime paths, packaging scripts, process-group wrapper | macOS-relevant changes | -| `macos-swift` | Swift lint, build, and tests for the macOS app | macOS-relevant changes | +| `macos-swift` | Swift lint and build for the macOS app, plus tests for the app and shared OpenClawKit package | macOS-relevant changes | | `ios-build` | Xcode project generation plus the iOS app simulator build | iOS app, shared app kit, or Swabble changes | | `android` | Android unit tests for both flavors plus one debug APK build | Android-relevant changes | | `openclaw/ci-gate` | Final aggregate: requires admission, preflight, and security; accepts skips only for manifest-disabled downstream lanes | Every non-draft CI run |