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",