MCPcopy Create free account
hub / github.com/github/gh-aw / TestResolvePiGatewaySecretEnvVar

Function TestResolvePiGatewaySecretEnvVar

pkg/workflow/pi_engine_test.go:255–267  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

253}
254
255func TestResolvePiGatewaySecretEnvVar(t *testing.T) {
256 t.Run("uses first core secret when present", func(t *testing.T) {
257 profile := universalLLMBackendProfile{coreSecretNames: []string{"CUSTOM_API_KEY", "SECOND"}}
258 assert.Equal(t, "CUSTOM_API_KEY", resolvePiGatewaySecretEnvVar(profile, UniversalLLMBackendAnthropic))
259 })
260
261 t.Run("falls back to backend defaults when core secrets are empty", func(t *testing.T) {
262 profile := universalLLMBackendProfile{}
263 assert.Equal(t, "ANTHROPIC_API_KEY", resolvePiGatewaySecretEnvVar(profile, UniversalLLMBackendAnthropic))
264 assert.Equal(t, "CODEX_API_KEY", resolvePiGatewaySecretEnvVar(profile, UniversalLLMBackendCodex))
265 assert.Equal(t, "COPILOT_GITHUB_TOKEN", resolvePiGatewaySecretEnvVar(profile, UniversalLLMBackendCopilot))
266 })
267}
268
269func TestPiEngine_GetExecutionSteps_ProviderPrefixCopilot(t *testing.T) {
270 engine := NewPiEngine()

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected