mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 17:15:57 +00:00
test: read qa auth profiles from sqlite
This commit is contained in:
@@ -516,11 +516,7 @@ describe("buildQaRuntimeEnv", () => {
|
||||
}
|
||||
|
||||
for (const agentId of ["main", "qa"]) {
|
||||
const storeRaw = await readFile(
|
||||
path.join(stateDir, "agents", agentId, "agent", "auth-profiles.json"),
|
||||
"utf8",
|
||||
);
|
||||
const storeProfiles = parseAuthProfileStore(storeRaw).profiles;
|
||||
const storeProfiles = readQaAuthProfiles(stateDir, agentId).profiles;
|
||||
for (const [profileId, provider] of [
|
||||
["qa-live-openai-env", "openai"],
|
||||
["qa-live-openai-codex-env", "openai-codex"],
|
||||
@@ -548,12 +544,8 @@ describe("buildQaRuntimeEnv", () => {
|
||||
},
|
||||
});
|
||||
|
||||
const storeRaw = await readFile(
|
||||
path.join(stateDir, "agents", "qa", "agent", "auth-profiles.json"),
|
||||
"utf8",
|
||||
);
|
||||
const storeProfile = requireAuthProfile(
|
||||
parseAuthProfileStore(storeRaw).profiles,
|
||||
readQaAuthProfiles(stateDir, "qa").profiles,
|
||||
"qa-live-openai-codex-env",
|
||||
);
|
||||
expect(storeProfile.type).toBe("api_key");
|
||||
@@ -674,12 +666,8 @@ describe("buildQaRuntimeEnv", () => {
|
||||
expect(configProfile.provider).toBe("openai-codex");
|
||||
expect(configProfile.mode).toBe("api_key");
|
||||
for (const agentId of ["main", "qa"]) {
|
||||
const storeRaw = await readFile(
|
||||
path.join(stateDir, "agents", agentId, "agent", "auth-profiles.json"),
|
||||
"utf8",
|
||||
);
|
||||
const storeProfile = requireAuthProfile(
|
||||
parseAuthProfileStore(storeRaw).profiles,
|
||||
readQaAuthProfiles(stateDir, agentId).profiles,
|
||||
"qa-live-openai-codex-env",
|
||||
);
|
||||
expect(storeProfile.type).toBe("api_key");
|
||||
@@ -726,12 +714,8 @@ describe("buildQaRuntimeEnv", () => {
|
||||
env,
|
||||
});
|
||||
|
||||
const storeRaw = await readFile(
|
||||
path.join(stateDir, "agents", "qa", "agent", "auth-profiles.json"),
|
||||
"utf8",
|
||||
);
|
||||
const storeProfile = requireAuthProfile(
|
||||
parseAuthProfileStore(storeRaw).profiles,
|
||||
readQaAuthProfiles(stateDir, "qa").profiles,
|
||||
"qa-live-openai-codex-env",
|
||||
);
|
||||
expect(storeProfile.type).toBe("api_key");
|
||||
@@ -772,12 +756,8 @@ describe("buildQaRuntimeEnv", () => {
|
||||
},
|
||||
});
|
||||
|
||||
const storeRaw = await readFile(
|
||||
path.join(stateDir, "agents", "main", "agent", "auth-profiles.json"),
|
||||
"utf8",
|
||||
);
|
||||
const storeProfile = requireAuthProfile(
|
||||
parseAuthProfileStore(storeRaw).profiles,
|
||||
readQaAuthProfiles(stateDir, "main").profiles,
|
||||
"qa-live-openai-codex-env",
|
||||
);
|
||||
expect(storeProfile.type).toBe("api_key");
|
||||
|
||||
Reference in New Issue
Block a user