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

Function TestGetGitHubHostForRepo

pkg/cli/github_test.go:149–225  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestGetGitHubHostForRepo(t *testing.T) {
150 tests := []struct {
151 name string
152 repo string
153 gheHost string
154 expectedHost string
155 }{
156 {
157 name: "non-allowlisted repo uses configured public host",
158 repo: "owner/repo",
159 gheHost: "",
160 expectedHost: "https://github.com",
161 },
162 {
163 name: "non-allowlisted repo uses GHE host",
164 repo: "owner/repo",
165 gheHost: "myorg.ghe.com",
166 expectedHost: "https://myorg.ghe.com",
167 },
168 {
169 name: "github/gh-aw always uses public GitHub",
170 repo: "github/gh-aw",
171 gheHost: "myorg.ghe.com",
172 expectedHost: "https://github.com",
173 },
174 {
175 name: "github/gh-aw with path always uses public GitHub",
176 repo: "github/gh-aw/workflows/ci-doctor.md",
177 gheHost: "myorg.ghe.com",
178 expectedHost: "https://github.com",
179 },
180 {
181 name: "githubnext/agentics always uses public GitHub",
182 repo: "githubnext/agentics",
183 gheHost: "myorg.ghe.com",
184 expectedHost: "https://github.com",
185 },
186 {
187 name: "githubnext/agentics with path always uses public GitHub",
188 repo: "githubnext/agentics/workflows/daily-plan.md",
189 gheHost: "myorg.ghe.com",
190 expectedHost: "https://github.com",
191 },
192 {
193 name: "githubnext/agentics without GHE host uses public GitHub",
194 repo: "githubnext/agentics",
195 gheHost: "",
196 expectedHost: "https://github.com",
197 },
198 {
199 name: "github org repository always uses public GitHub",
200 repo: "github/copilot",
201 gheHost: "myorg.ghe.com",
202 expectedHost: "https://github.com",
203 },
204 {
205 name: "microsoft org repository always uses public GitHub",
206 repo: "microsoft/vscode",

Callers

nothing calls this directly

Calls 4

getGitHubHostForRepoFunction · 0.85
SetenvMethod · 0.80
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected