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

Function TestCollectMCPScriptsSecrets

pkg/workflow/mcp_scripts_renderer_test.go:9–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestCollectMCPScriptsSecrets(t *testing.T) {
10 tests := []struct {
11 name string
12 config *MCPScriptsConfig
13 expectedLen int
14 }{
15 {
16 name: "nil config",
17 config: nil,
18 expectedLen: 0,
19 },
20 {
21 name: "tool with secrets",
22 config: &MCPScriptsConfig{
23 Tools: map[string]*MCPScriptToolConfig{
24 "test": {
25 Name: "test",
26 Env: map[string]string{
27 "API_KEY": "${{ secrets.API_KEY }}",
28 },
29 },
30 },
31 },
32 expectedLen: 1,
33 },
34 }
35
36 for _, tt := range tests {
37 t.Run(tt.name, func(t *testing.T) {
38 result := collectMCPScriptsSecrets(tt.config)
39
40 if len(result) != tt.expectedLen {
41 t.Errorf("Expected %d secrets, got %d", tt.expectedLen, len(result))
42 }
43 })
44 }
45}
46
47func TestCollectMCPScriptsSecretsStability(t *testing.T) {
48 config := &MCPScriptsConfig{

Callers

nothing calls this directly

Calls 3

collectMCPScriptsSecretsFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected