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

Function TestExtractBaseRepo_Integration

pkg/cli/update_actions_integration_test.go:11–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestExtractBaseRepo_Integration(t *testing.T) {
12 // Test that extractBaseRepo correctly handles real-world action paths
13 // from actions-lock.json
14 realWorldCases := map[string]string{
15 // Actions with subfolders (the problematic cases)
16 "actions/cache/restore": "actions/cache",
17 "actions/cache/save": "actions/cache",
18 "github/codeql-action/upload-sarif": "github/codeql-action",
19 "github/codeql-action/analyze": "github/codeql-action",
20 "github/codeql-action/init": "github/codeql-action",
21
22 // Regular actions (should remain unchanged)
23 "actions/checkout": "actions/checkout",
24 "actions/setup-node": "actions/setup-node",
25 "actions/setup-python": "actions/setup-python",
26 "actions/setup-go": "actions/setup-go",
27 "github/stale-repos": "github/stale-repos",
28 "actions/ai-inference": "actions/ai-inference",
29 "actions/create-github-app-token": "actions/create-github-app-token",
30 }
31
32 for actionPath, expectedBase := range realWorldCases {
33 t.Run(actionPath, func(t *testing.T) {
34 got := gitutil.ExtractBaseRepo(actionPath)
35 if got != expectedBase {
36 t.Errorf("gitutil.ExtractBaseRepo(%q) = %q, want %q", actionPath, got, expectedBase)
37 }
38 })
39 }
40}
41
42// TestExtractBaseRepoAPICompatibility verifies that the base repo can be used
43// to construct valid GitHub API URLs

Callers

nothing calls this directly

Calls 3

ExtractBaseRepoFunction · 0.92
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected