MCPcopy Create free account
hub / github.com/coder/coder / TestConnectAll_DisabledServer

Function TestConnectAll_DisabledServer

coderd/x/chatd/mcpclient/mcpclient_test.go:434–447  ·  view source on GitHub ↗

TestConnectAll_DisabledServer verifies that disabled configs are silently skipped.

(t *testing.T)

Source from the content-addressed store, hash-verified

432// TestConnectAll_DisabledServer verifies that disabled configs are
433// silently skipped.
434func TestConnectAll_DisabledServer(t *testing.T) {
435 t.Parallel()
436 ctx := context.Background()
437 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
438
439 ts := newTestMCPServer(t, echoTool())
440
441 cfg := makeConfig("disabled", ts.URL)
442 cfg.Enabled = false
443
444 tools, cleanup := mcpclient.ConnectAll(ctx, logger, []database.MCPServerConfig{cfg}, nil, uuid.Nil, nil, nil)
445 t.Cleanup(cleanup)
446 assert.Empty(t, tools)
447}
448
449// TestConnectAll_CallToolInvalidInput verifies that malformed JSON
450// input returns an error response rather than a Go error.

Callers

nothing calls this directly

Calls 6

ConnectAllFunction · 0.92
newTestMCPServerFunction · 0.85
echoToolFunction · 0.85
makeConfigFunction · 0.85
CleanupMethod · 0.65
EmptyMethod · 0.45

Tested by

no test coverage detected