(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func 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 | |
| 47 | func TestCollectMCPScriptsSecretsStability(t *testing.T) { |
| 48 | config := &MCPScriptsConfig{ |
nothing calls this directly
no test coverage detected