mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 11:50:45 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
36 lines
1.2 KiB
Swift
36 lines
1.2 KiB
Swift
import OpenClawKit
|
|
import Testing
|
|
@testable import OpenClaw
|
|
|
|
@Suite struct GatewayStatusBuilderTests {
|
|
@Test func pausedProblemKeepsErrorStatus() {
|
|
let state = GatewayStatusBuilder.build(
|
|
gatewayServerName: nil,
|
|
lastGatewayProblem: GatewayConnectionProblem(
|
|
kind: .pairingRequired,
|
|
owner: .gateway,
|
|
title: "Pairing required",
|
|
message: "Approve this device before reconnecting.",
|
|
requestId: "req-123",
|
|
retryable: false,
|
|
pauseReconnect: true),
|
|
gatewayStatusText: "Reconnecting…")
|
|
|
|
#expect(state == .error)
|
|
}
|
|
|
|
@Test func transientProblemAllowsConnectingStatus() {
|
|
let state = GatewayStatusBuilder.build(
|
|
gatewayServerName: nil,
|
|
lastGatewayProblem: GatewayConnectionProblem(
|
|
kind: .timeout,
|
|
owner: .network,
|
|
title: "Connection timed out",
|
|
message: "The gateway did not respond before the connection timed out.",
|
|
retryable: true,
|
|
pauseReconnect: false),
|
|
gatewayStatusText: "Reconnecting…")
|
|
|
|
#expect(state == .connecting)
|
|
}
|
|
}
|