From d75fa152b9e33c8fa0dcb74de388a8b5b21fa7fc Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 3 Apr 2026 11:22:40 +0100 Subject: [PATCH] test: trim secrets runtime snapshot setup --- src/secrets/runtime.auth.integration.test.ts | 5 +++++ src/secrets/runtime.gateway-auth.integration.test.ts | 3 +++ src/secrets/runtime.integration.test-helpers.ts | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/secrets/runtime.auth.integration.test.ts b/src/secrets/runtime.auth.integration.test.ts index 14fab14f47c..922eaa7b02e 100644 --- a/src/secrets/runtime.auth.integration.test.ts +++ b/src/secrets/runtime.auth.integration.test.ts @@ -15,6 +15,7 @@ import { asConfig, createOpenAIFileRuntimeConfig, createOpenAIFileRuntimeFixture, + EMPTY_LOADABLE_PLUGIN_ORIGINS, expectResolvedOpenAIRuntime, loadAuthStoreWithProfiles, OPENAI_ENV_KEY_REF, @@ -73,6 +74,7 @@ describe("secrets runtime snapshot auth integration", () => { }), env: { OPENAI_API_KEY: "sk-runtime" }, agentDirs: ["/tmp/openclaw-agent-main"], + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, loadAuthStore: () => loadAuthStoreWithProfiles({ "openai:default": { @@ -106,6 +108,7 @@ describe("secrets runtime snapshot auth integration", () => { const prepared = await prepareSecretsRuntimeSnapshot({ config: createOpenAIFileRuntimeConfig(secretFile), agentDirs: [agentDir], + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, }); activateSecretsRuntimeSnapshot(prepared); @@ -147,6 +150,7 @@ describe("secrets runtime snapshot auth integration", () => { const prepared = await prepareSecretsRuntimeSnapshot({ config: createOpenAIFileRuntimeConfig(secretFile), agentDirs: [agentDir], + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, loadAuthStore, }); @@ -220,6 +224,7 @@ describe("secrets runtime snapshot auth integration", () => { OPENAI_API_KEY: "sk-main-runtime", ANTHROPIC_API_KEY: "sk-ops-runtime", }, + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, }); activateSecretsRuntimeSnapshot(prepared); diff --git a/src/secrets/runtime.gateway-auth.integration.test.ts b/src/secrets/runtime.gateway-auth.integration.test.ts index 7cedba4198f..b8a959e2c2c 100644 --- a/src/secrets/runtime.gateway-auth.integration.test.ts +++ b/src/secrets/runtime.gateway-auth.integration.test.ts @@ -12,6 +12,7 @@ import { withTempHome } from "../config/home-env.test-harness.js"; import { captureEnv, withEnvAsync } from "../test-utils/env.js"; import { asConfig, + EMPTY_LOADABLE_PLUGIN_ORIGINS, loadAuthStoreWithProfiles, SECRETS_RUNTIME_INTEGRATION_TIMEOUT_MS, } from "./runtime.integration.test-helpers.js"; @@ -70,6 +71,7 @@ describe("secrets runtime snapshot gateway-auth integration", () => { }), env: {}, agentDirs: ["/tmp/openclaw-agent-main"], + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, loadAuthStore: () => ({ version: 1, profiles: {} }), }), ).rejects.toThrow(/MISSING_GATEWAY_AUTH_TOKEN/i); @@ -105,6 +107,7 @@ describe("secrets runtime snapshot gateway-auth integration", () => { GATEWAY_AUTH_TOKEN: "gateway-runtime-token", }, agentDirs: ["/tmp/openclaw-agent-main"], + loadablePluginOrigins: EMPTY_LOADABLE_PLUGIN_ORIGINS, loadAuthStore: () => loadAuthStoreWithProfiles({}), }); diff --git a/src/secrets/runtime.integration.test-helpers.ts b/src/secrets/runtime.integration.test-helpers.ts index 60e77198ff7..911003d7807 100644 --- a/src/secrets/runtime.integration.test-helpers.ts +++ b/src/secrets/runtime.integration.test-helpers.ts @@ -4,6 +4,7 @@ import { expect } from "vitest"; import { ensureAuthProfileStore, type AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { loadConfig } from "../config/config.js"; +import type { PluginOrigin } from "../plugins/types.js"; export const OPENAI_ENV_KEY_REF = { source: "env", @@ -18,6 +19,7 @@ export const OPENAI_FILE_KEY_REF = { } as const; export const SECRETS_RUNTIME_INTEGRATION_TIMEOUT_MS = 300_000; +export const EMPTY_LOADABLE_PLUGIN_ORIGINS: ReadonlyMap = new Map(); const allowInsecureTempSecretFile = process.platform === "win32";