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

Function newSocketClient

agent/agentsocket/service_test.go:29–39  ·  view source on GitHub ↗

newSocketClient creates a DRPC client connected to the Unix socket at the given path.

(ctx context.Context, t *testing.T, socketPath string)

Source from the content-addressed store, hash-verified

27
28// newSocketClient creates a DRPC client connected to the Unix socket at the given path.
29func newSocketClient(ctx context.Context, t *testing.T, socketPath string) *agentsocket.Client {
30 t.Helper()
31
32 client, err := agentsocket.NewClient(ctx, agentsocket.WithPath(socketPath))
33 t.Cleanup(func() {
34 _ = client.Close()
35 })
36 require.NoError(t, err)
37
38 return client
39}
40
41func TestDRPCAgentSocketService(t *testing.T) {
42 t.Parallel()

Callers 1

Calls 5

CloseMethod · 0.95
NewClientFunction · 0.92
WithPathFunction · 0.92
HelperMethod · 0.65
CleanupMethod · 0.65

Tested by

no test coverage detected