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

Function TestGetRequiredSecretsForEngine

pkg/cli/engine_secrets_test.go:16–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestGetRequiredSecretsForEngine(t *testing.T) {
17 tests := []struct {
18 name string
19 engine string
20 includeSystemSecrets bool
21 includeOptional bool
22 wantSecretNames []string
23 wantMinCount int
24 wantMaxCount int
25 }{
26 {
27 name: "copilot engine without system secrets",
28 engine: string(constants.CopilotEngine),
29 includeSystemSecrets: false,
30 includeOptional: false,
31 wantSecretNames: []string{"COPILOT_GITHUB_TOKEN"},
32 wantMinCount: 1,
33 wantMaxCount: 1,
34 },
35 {
36 name: "copilot engine with system secrets",
37 engine: string(constants.CopilotEngine),
38 includeSystemSecrets: true,
39 includeOptional: false,
40 wantSecretNames: []string{"COPILOT_GITHUB_TOKEN"}, // No system secrets since all are optional
41 wantMinCount: 1,
42 wantMaxCount: 1,
43 },
44 {
45 name: "copilot engine with optional secrets",
46 engine: string(constants.CopilotEngine),
47 includeSystemSecrets: true,
48 includeOptional: true,
49 wantSecretNames: []string{"COPILOT_GITHUB_TOKEN", "GH_AW_GITHUB_TOKEN"},
50 wantMinCount: 3, // At least 3 (required system + optional system + engine)
51 wantMaxCount: 10,
52 },
53 {
54 name: "claude engine",
55 engine: string(constants.ClaudeEngine),
56 includeSystemSecrets: false,
57 includeOptional: false,
58 wantSecretNames: []string{"ANTHROPIC_API_KEY"},
59 wantMinCount: 1,
60 wantMaxCount: 1,
61 },
62 {
63 name: "codex engine",
64 engine: string(constants.CodexEngine),
65 includeSystemSecrets: false,
66 includeOptional: false,
67 wantSecretNames: []string{"OPENAI_API_KEY"},
68 wantMinCount: 1,
69 wantMaxCount: 1,
70 },
71 {
72 name: "empty engine returns only system secrets when requested",
73 engine: "",

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected