feat: add end 2 end tests

This commit is contained in:
Jon Lundy
2023-01-25 10:35:09 -07:00
parent f9a088269c
commit 0f504a98e9
13 changed files with 268 additions and 230 deletions

View File

@@ -21,17 +21,21 @@ func main() {
<-ctx.Done()
defer cancel() // restore interrupt function
}()
if err := Run(ctx); err != nil {
log.Fatal(err)
os.Exit(1)
}
}
func Run(ctx context.Context) error {
svc := &service.Harness{}
ctx, stop := lg.Init(ctx, appName)
svc.OnStop(stop)
svc.Add(lg.NewHTTP(ctx))
svc.Setup(ctx, apps.Apps()...)
// Run application
if err := svc.Run(ctx, appName, version); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatal(err)
return err
}
return nil
}