test: read qa auth profiles from sqlite

This commit is contained in:
Peter Steinberger
2026-05-17 16:28:57 +01:00
parent 5d7bba5f1f
commit 5cb4cc6e6d

View File

@@ -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");