Add test for jobs (#34)

This commit is contained in:
Jonas Plum
2022-02-27 18:33:50 +01:00
committed by GitHub
parent fd18458f3d
commit ffba7b4f5f
18 changed files with 181 additions and 80 deletions

View File

@@ -144,7 +144,7 @@ func DB(t *testing.T) (context.Context, *catalyst.Config, *bus.Bus, *index.Index
return nil, nil, nil, nil, nil, nil, nil, err
}
_, err = db.JobCreate(ctx, "99cd67131b48", &model.JobForm{
_, err = db.JobCreate(ctx, "b81c2366-ea37-43d2-b61b-03afdc21d985", &model.JobForm{
Automation: "hash.sha1",
Payload: "test",
Origin: nil,
@@ -201,6 +201,7 @@ func Catalyst(t *testing.T) (context.Context, *catalyst.Config, *catalyst.Server
t.Fatal(err)
}
config.DB.Name = cleanName(t)
config.IndexPath = cleanName(t) + ".bleve"
c, err := catalyst.New(&hooks.Hooks{
DatabaseAfterConnectFuncs: []func(ctx context.Context, client driver.Client, name string){Clear},