(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestConnectAll_MultipleServers(t *testing.T) { |
| 189 | t.Parallel() |
| 190 | ctx := context.Background() |
| 191 | logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) |
| 192 | |
| 193 | ts1 := newTestMCPServer(t, echoTool()) |
| 194 | ts2 := newTestMCPServer(t, greetTool()) |
| 195 | |
| 196 | cfg1 := makeConfig("alpha", ts1.URL) |
| 197 | cfg2 := makeConfig("beta", ts2.URL) |
| 198 | |
| 199 | tools, cleanup := mcpclient.ConnectAll( |
| 200 | ctx, logger, |
| 201 | []database.MCPServerConfig{cfg1, cfg2}, |
| 202 | nil, |
| 203 | uuid.Nil, nil, |
| 204 | nil, |
| 205 | ) |
| 206 | t.Cleanup(cleanup) |
| 207 | |
| 208 | require.Len(t, tools, 2) |
| 209 | |
| 210 | names := toolNames(tools) |
| 211 | assert.Contains(t, names, "alpha__echo") |
| 212 | assert.Contains(t, names, "beta__greet") |
| 213 | } |
| 214 | |
| 215 | func TestConnectAll_NoToolsAfterFiltering(t *testing.T) { |
| 216 | t.Parallel() |
nothing calls this directly
no test coverage detected