(t *testing.T, ctx context.Context, opts ...ServerOption)
| 43 | } |
| 44 | |
| 45 | func startStandaloneSvr(t *testing.T, ctx context.Context, opts ...ServerOption) (*Server, string) { |
| 46 | ln := getListener(t) |
| 47 | defaultOpts := []ServerOption{ |
| 48 | WithHttpListener(ln), |
| 49 | WithTubeFactoryBuilders(GetBuiltinTubeFactoryBuilder()), |
| 50 | WithRuntimeFactoryBuilders(GetBuiltinRuntimeFactoryBuilder()), |
| 51 | } |
| 52 | s, err := NewServer( |
| 53 | append(defaultOpts, opts...)..., |
| 54 | ) |
| 55 | if err != nil { |
| 56 | t.Fatal(err) |
| 57 | } |
| 58 | svrCtx, svrCancel := context.WithCancel(context.Background()) |
| 59 | go s.Run(svrCtx) |
| 60 | go func() { |
| 61 | <-ctx.Done() |
| 62 | svrCancel() |
| 63 | }() |
| 64 | return s, ln.Addr().String() |
| 65 | } |
| 66 | |
| 67 | func TestStandaloneBasicFunction(t *testing.T) { |
| 68 | ctx, cancel := context.WithCancel(context.Background()) |
no test coverage detected