MCPcopy Index your code
hub / github.com/docker/docker-agent / startServerWithStore

Function startServerWithStore

pkg/server/server_test.go:304–327  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, agentsDir string, store session.Store)

Source from the content-addressed store, hash-verified

302}
303
304func startServerWithStore(t *testing.T, ctx context.Context, agentsDir string, store session.Store) string {
305 t.Helper()
306
307 runConfig := config.RuntimeConfig{}
308
309 sources, err := config.ResolveSources(agentsDir, nil)
310 require.NoError(t, err)
311 srv, err := New(ctx, store, &runConfig, 0, sources, "")
312 require.NoError(t, err)
313
314 socketPath := "unix://" + filepath.Join(t.TempDir(), "sock")
315 ln, err := Listen(ctx, socketPath)
316 require.NoError(t, err)
317 go func() {
318 <-ctx.Done()
319 _ = ln.Close()
320 }()
321
322 go func() {
323 _ = srv.Serve(ctx, ln)
324 }()
325
326 return socketPath
327}
328
329type mockStore struct {
330 session.Store

Callers 2

TestServer_ForkSessionFunction · 0.85

Calls 5

ResolveSourcesFunction · 0.92
ListenFunction · 0.85
ServeMethod · 0.80
NewFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected