mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
perf(test): isolate models config auth fixtures
This commit is contained in:
parent
e99b5deb7a
commit
1fdb0e79d3
1 changed files with 27 additions and 0 deletions
|
|
@ -22,6 +22,33 @@ vi.mock("./provider-auth-aliases.js", () => ({
|
|||
resolveProviderIdForAuth: (provider: string) => provider.trim().toLowerCase(),
|
||||
}));
|
||||
|
||||
// These planner tests exercise no plugin-owned auth policy. Keep their exact
|
||||
// provider markers local instead of loading the bundled plugin/runtime catalog.
|
||||
vi.mock("../plugins/provider-runtime.js", () => ({
|
||||
applyProviderNativeStreamingUsageCompatWithPlugin: () => undefined,
|
||||
normalizeProviderConfigWithPlugin: () => undefined,
|
||||
resolveProviderConfigApiKeyWithPlugin: () => undefined,
|
||||
resolveExternalAuthProfilesWithPlugins: () => [],
|
||||
resolveProviderSyntheticAuthWithPlugin: () => undefined,
|
||||
}));
|
||||
|
||||
vi.mock("./model-auth-env-vars.js", () => ({
|
||||
listKnownProviderEnvApiKeyNames: () => [
|
||||
"GOOGLE_CLOUD_API_KEY",
|
||||
"OPENAI_API_KEY",
|
||||
"OPENROUTER_API_KEY",
|
||||
],
|
||||
resolveProviderEnvAuthLookupMaps: () => ({
|
||||
aliasMap: {},
|
||||
envCandidateMap: {
|
||||
"google-vertex": ["GOOGLE_CLOUD_API_KEY"],
|
||||
openai: ["OPENAI_API_KEY"],
|
||||
openrouter: ["OPENROUTER_API_KEY"],
|
||||
},
|
||||
authEvidenceMap: {},
|
||||
}),
|
||||
}));
|
||||
|
||||
const TEST_ENV_VAR = "OPENCLAW_MODELS_CONFIG_TEST_ENV";
|
||||
|
||||
function createImplicitOpenRouterProvider(): ProviderConfig {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue