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

Function TestCheckAndSuggestSecrets

pkg/cli/mcp_secrets_test.go:30–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestCheckAndSuggestSecrets(t *testing.T) {
31 t.Parallel()
32
33 tests := []struct {
34 name string
35 toolConfig map[string]any
36 verbose bool
37 wantErr bool
38 skipReason string
39 }{
40 {
41 name: "no mcp section",
42 toolConfig: map[string]any{
43 "other": "config",
44 },
45 verbose: false,
46 wantErr: false,
47 },
48 {
49 name: "mcp section without env",
50 toolConfig: map[string]any{
51 "mcp": map[string]any{
52 "command": "test",
53 },
54 },
55 verbose: false,
56 wantErr: false,
57 },
58 {
59 name: "mcp with env but no secrets",
60 toolConfig: map[string]any{
61 "mcp": map[string]any{
62 "env": map[string]string{
63 "PLAIN_VAR": "plain_value",
64 },
65 },
66 },
67 verbose: false,
68 wantErr: false,
69 },
70 {
71 name: "mcp with secrets in env",
72 toolConfig: map[string]any{
73 "mcp": map[string]any{
74 "env": map[string]string{
75 "API_KEY": "${{ secrets.DD_API_KEY }}",
76 "TOKEN": "${{ secrets.AUTH_TOKEN }}",
77 },
78 },
79 },
80 verbose: true,
81 wantErr: false,
82 skipReason: "requires GitHub CLI and repository access",
83 },
84 {
85 name: "empty tool config",
86 toolConfig: map[string]any{},
87 verbose: false,

Callers

nothing calls this directly

Calls 4

checkAndSuggestSecretsFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected