fakeMCPServerConfig returns a ServerConfig that launches a fake MCP server using the test binary re-exec pattern.
(t *testing.T, name string)
| 40 | // fakeMCPServerConfig returns a ServerConfig that launches a fake |
| 41 | // MCP server using the test binary re-exec pattern. |
| 42 | func 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 | |
| 61 | func TestSnapshotChanged(t *testing.T) { |
| 62 | t.Parallel() |
no test coverage detected