mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(macos): keep mocked gateway probe routes off the operator identity store (#121398)
This commit is contained in:
committed by
GitHub
parent
9d77e5c3b7
commit
f37507cac2
@@ -225,6 +225,22 @@ actor GatewayConnection {
|
||||
sessionProvider: sessionProvider)
|
||||
self.clientShutdown = clientShutdown
|
||||
}
|
||||
|
||||
init(
|
||||
testEndpointProvider: @escaping EndpointProvider,
|
||||
sessionBox: WebSocketSessionBox? = nil)
|
||||
{
|
||||
self.endpointProvider = testEndpointProvider
|
||||
self.supportsSharedEndpointRecovery = false
|
||||
self.activationBindingKeyProvider = { GatewayConnection.testingActivationBindingKey }
|
||||
// Mock WebSocket routes do not exercise device authentication and must not
|
||||
// depend on the process-global persisted identity store.
|
||||
self.includeDeviceIdentity = false
|
||||
self.sessionProvider = Self.resolveSessionProvider(
|
||||
sessionBox: sessionBox,
|
||||
sessionProvider: nil)
|
||||
self.clientShutdown = { client in await client.shutdown() }
|
||||
}
|
||||
#endif
|
||||
|
||||
private static func resolveSessionProvider(
|
||||
|
||||
@@ -234,8 +234,10 @@ private func onboardingProbeFixture(
|
||||
reply: OnboardingProbeReply = .configured) -> OnboardingProbeFixture
|
||||
{
|
||||
let session = GatewayTestWebSocketSession(taskFactory: onboardingProbeTaskFactory(reply: reply))
|
||||
// The production endpointProvider init reads the process-global persisted
|
||||
// identity store; mocked routes must stay off the operator's real state.
|
||||
let gateway = GatewayConnection(
|
||||
endpointProvider: endpointProvider,
|
||||
testEndpointProvider: endpointProvider,
|
||||
sessionBox: WebSocketSessionBox(session: session))
|
||||
return OnboardingProbeFixture(
|
||||
session: session,
|
||||
|
||||
Reference in New Issue
Block a user