perf(test): isolate models config auth fixtures

This commit is contained in:
Peter Steinberger 2026-07-09 07:48:05 -04:00
parent e99b5deb7a
commit 1fdb0e79d3

View file

@ -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 {