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

Function startDERP

enterprise/derpmesh/derpmesh_test.go:258–270  ·  view source on GitHub ↗
(t *testing.T, tlsConfig *tls.Config)

Source from the content-addressed store, hash-verified

256}
257
258func startDERP(t *testing.T, tlsConfig *tls.Config) (*derp.Server, string) {
259 logf := tailnet.Logger(testutil.Logger(t))
260 d := derp.NewServer(key.NewNode(), logf)
261 d.SetMeshKey("some-key")
262 server := httptest.NewUnstartedServer(derphttp.Handler(d))
263 server.TLS = tlsConfig
264 server.StartTLS()
265 t.Cleanup(func() {
266 _ = d.Close()
267 })
268 t.Cleanup(server.Close)
269 return d, server.URL
270}

Callers 1

TestDERPMeshFunction · 0.85

Calls 5

CloseMethod · 0.95
LoggerFunction · 0.92
LoggerFunction · 0.92
CleanupMethod · 0.65
HandlerMethod · 0.45

Tested by

no test coverage detected