MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / startStandaloneSvr

Function startStandaloneSvr

server/server_test.go:45–65  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, opts ...ServerOption)

Source from the content-addressed store, hash-verified

43}
44
45func 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
67func TestStandaloneBasicFunction(t *testing.T) {
68 ctx, cancel := context.WithCancel(context.Background())

Callers 3

TestHttpTubeFunction · 0.85
TestStatefulFunctionFunction · 0.85

Calls 9

RunMethod · 0.95
getListenerFunction · 0.85
WithHttpListenerFunction · 0.85
WithTubeFactoryBuildersFunction · 0.85
NewServerFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected