(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestGetEffectiveAgentGitHubToken(t *testing.T) { |
| 94 | tests := []struct { |
| 95 | name string |
| 96 | customToken string |
| 97 | expected string |
| 98 | }{ |
| 99 | { |
| 100 | name: "custom token has highest precedence", |
| 101 | customToken: "${{ secrets.CUSTOM_AGENT_TOKEN }}", |
| 102 | expected: "${{ secrets.CUSTOM_AGENT_TOKEN }}", |
| 103 | }, |
| 104 | { |
| 105 | name: "default fallback chain for agent operations", |
| 106 | customToken: "", |
| 107 | expected: "${{ secrets.GH_AW_AGENT_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}", |
| 108 | }, |
| 109 | } |
| 110 | |
| 111 | for _, tt := range tests { |
| 112 | t.Run(tt.name, func(t *testing.T) { |
| 113 | result := getEffectiveCopilotCodingAgentGitHubToken(tt.customToken) |
| 114 | if result != tt.expected { |
| 115 | t.Errorf("getEffectiveCopilotCodingAgentGitHubToken() = %q, want %q", result, tt.expected) |
| 116 | } |
| 117 | }) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestGetEffectiveCITriggerGitHubToken(t *testing.T) { |
| 122 | tests := []struct { |
nothing calls this directly
no test coverage detected