(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestOpenCodeEngineProviderProfiles(t *testing.T) { |
| 77 | engine := NewOpenCodeEngine() |
| 78 | |
| 79 | t.Run("anthropic model uses anthropic secret", func(t *testing.T) { |
| 80 | workflowData := &WorkflowData{ |
| 81 | EngineConfig: &EngineConfig{Model: "anthropic/claude-sonnet-4"}, |
| 82 | ParsedTools: &ToolsConfig{}, |
| 83 | Tools: map[string]any{}, |
| 84 | } |
| 85 | secrets := engine.GetRequiredSecretNames(workflowData) |
| 86 | assert.Contains(t, secrets, "ANTHROPIC_API_KEY", "Should require ANTHROPIC_API_KEY for anthropic/* models") |
| 87 | assert.NotContains(t, secrets, "COPILOT_GITHUB_TOKEN", "Should not require COPILOT_GITHUB_TOKEN for anthropic/* models") |
| 88 | }) |
| 89 | |
| 90 | t.Run("openai model uses codex/openai secrets", func(t *testing.T) { |
| 91 | workflowData := &WorkflowData{ |
| 92 | EngineConfig: &EngineConfig{Model: "openai/gpt-4.1"}, |
| 93 | ParsedTools: &ToolsConfig{}, |
| 94 | Tools: map[string]any{}, |
| 95 | } |
| 96 | secrets := engine.GetRequiredSecretNames(workflowData) |
| 97 | assert.Contains(t, secrets, "CODEX_API_KEY", "Should require CODEX_API_KEY for openai/* models") |
| 98 | assert.Contains(t, secrets, "OPENAI_API_KEY", "Should require OPENAI_API_KEY for openai/* models") |
| 99 | }) |
| 100 | } |
nothing calls this directly
no test coverage detected