MCPcopy Index your code
hub / github.com/coder/coder / fakeMCPServerConfig

Function fakeMCPServerConfig

agent/x/agentmcp/reload_internal_test.go:42–59  ·  view source on GitHub ↗

fakeMCPServerConfig returns a ServerConfig that launches a fake MCP server using the test binary re-exec pattern.

(t *testing.T, name string)

Source from the content-addressed store, hash-verified

40// fakeMCPServerConfig returns a ServerConfig that launches a fake
41// MCP server using the test binary re-exec pattern.
42func fakeMCPServerConfig(t *testing.T, name string) (ServerConfig, mcpServerEntry) {
43 t.Helper()
44 testBin, err := os.Executable()
45 require.NoError(t, err)
46 cfg := ServerConfig{
47 Name: name,
48 Transport: "stdio",
49 Command: testBin,
50 Args: []string{"-test.run=^TestConnectServer_StdioProcessSurvivesConnect$"},
51 Env: map[string]string{"TEST_MCP_FAKE_SERVER": "1"},
52 }
53 entry := mcpServerEntry{
54 Command: testBin,
55 Args: []string{"-test.run=^TestConnectServer_StdioProcessSurvivesConnect$"},
56 Env: map[string]string{"TEST_MCP_FAKE_SERVER": "1"},
57 }
58 return cfg, entry
59}
60
61func TestSnapshotChanged(t *testing.T) {
62 t.Parallel()

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected