From 2ea8c3e98153940d185b86d82831ed9756c1d70f Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 12 Jul 2026 16:31:19 +0200 Subject: [PATCH] =?UTF-8?q?test:=20=E5=9B=BA=E5=8C=96=20pika=20API=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/src/agentrun.test.ts | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/scripts/src/agentrun.test.ts b/scripts/src/agentrun.test.ts index b81c2a71..068844e9 100644 --- a/scripts/src/agentrun.test.ts +++ b/scripts/src/agentrun.test.ts @@ -986,6 +986,11 @@ describe("AgentRun YAML tool credential binding", () => { id: secret.id, sourceMode: secret.sourceMode, sourceRef: secret.sourceRef, + sourceKey: secret.sourceKey, + sourceFormat: secret.sourceFormat, + transform: secret.transform, + codexConfig: secret.codexConfig, + jsonValue: secret.jsonValue, sourceProfile: secret.providerCredentialSourceProfile, effectiveBackendProfile: secret.providerCredentialProfile, targetRef: secret.targetRef, @@ -994,6 +999,11 @@ describe("AgentRun YAML tool credential binding", () => { id: "provider-gpt-pika-auth-json", sourceMode: "file", sourceRef: "/root/.codex/auth.json.pika", + sourceKey: null, + sourceFormat: null, + transform: null, + codexConfig: null, + jsonValue: null, sourceProfile: "gpt.pika", effectiveBackendProfile: "gpt-pika", targetRef: { namespace: "agentrun-v02", name: "agentrun-v02-provider-gpt-pika", key: "auth.json" }, @@ -1002,11 +1012,42 @@ describe("AgentRun YAML tool credential binding", () => { id: "provider-gpt-pika-config", sourceMode: "file", sourceRef: "/root/.codex/config.toml.pika", + sourceKey: null, + sourceFormat: null, + transform: null, + codexConfig: null, + jsonValue: null, sourceProfile: "gpt.pika", effectiveBackendProfile: "gpt-pika", targetRef: { namespace: "agentrun-v02", name: "agentrun-v02-provider-gpt-pika", key: "config.toml" }, }, ]); + const renderedPikaSources = collectLaneSecretSources(spec).filter((source) => source.providerCredentialSourceProfile === "gpt.pika"); + expect(renderedPikaSources.map((source) => ({ + id: source.id, + sourceMode: source.sourceMode, + sourceRef: source.sourceRef, + sourceKey: source.sourceKey, + sourceFormat: source.sourceFormat, + transform: source.transform, + codexConfig: source.codexConfig, + jsonValue: source.jsonValue, + sourceProfile: source.providerCredentialSourceProfile, + effectiveBackendProfile: source.providerCredentialProfile, + targetRef: source.targetRef, + }))).toEqual(pikaSecrets.map((secret) => ({ + id: secret.id, + sourceMode: secret.sourceMode, + sourceRef: secret.sourceRef, + sourceKey: secret.sourceKey, + sourceFormat: secret.sourceFormat, + transform: secret.transform, + codexConfig: secret.codexConfig, + jsonValue: secret.jsonValue, + sourceProfile: secret.providerCredentialSourceProfile, + effectiveBackendProfile: secret.providerCredentialProfile, + targetRef: secret.targetRef, + }))); const expected = [{ sourceProfile: "gpt.pika", profile: "gpt-pika",