feat(app): pass context to start process

This commit is contained in:
2023-10-19 20:05:59 +02:00
parent 4d064de164
commit efb8ba8b99
13 changed files with 46 additions and 35 deletions

View File

@ -42,7 +42,8 @@ func TestAuthModule(t *testing.T) {
t.Fatal(err)
}
if err := server.Start(); err != nil {
ctx := context.Background()
if err := server.Start(ctx); err != nil {
t.Fatalf("%+v", errors.WithStack(err))
}
@ -70,7 +71,7 @@ func TestAuthModule(t *testing.T) {
req.Header.Add("Authorization", "Bearer "+string(rawToken))
ctx := context.WithValue(context.Background(), edgeHTTP.ContextKeyOriginRequest, req)
ctx = context.WithValue(context.Background(), edgeHTTP.ContextKeyOriginRequest, req)
if _, err := server.ExecFuncByName(ctx, "testAuth", ctx); err != nil {
t.Fatalf("%+v", errors.WithStack(err))
@ -98,7 +99,8 @@ func TestAuthAnonymousModule(t *testing.T) {
t.Fatal(err)
}
if err := server.Start(); err != nil {
ctx := context.Background()
if err := server.Start(ctx); err != nil {
t.Fatalf("%+v", errors.WithStack(err))
}
@ -109,7 +111,7 @@ func TestAuthAnonymousModule(t *testing.T) {
t.Fatalf("%+v", errors.WithStack(err))
}
ctx := context.WithValue(context.Background(), edgeHTTP.ContextKeyOriginRequest, req)
ctx = context.WithValue(context.Background(), edgeHTTP.ContextKeyOriginRequest, req)
if _, err := server.ExecFuncByName(ctx, "testAuth", ctx); err != nil {
t.Fatalf("%+v", errors.WithStack(err))