Isolate runner object store construction

This commit is contained in:
2026-09-04 13:01:00 +00:00
parent 2e69c14898
commit 6a15052d77
4 changed files with 35 additions and 17 deletions

View File

@@ -206,21 +206,18 @@ previous_session_id: 2026-04-26
mustReadEquals(t, filepath.Join(sessionRoot, "previous", "artifacts", "session_recap.md"), "# previous recap\n")
scriptoriumFake := &scriptorium.FakeRunner{}
origObjectStoreFn := newObjectStoreFromConfigFn
objectStoreConstructed := false
t.Cleanup(func() {
newObjectStoreFromConfigFn = origObjectStoreFn
})
executor := func(ctx context.Context, cfg *config.Config, plan BoundedPlan, opts RunOptions) (*RunSummary, error) {
if opts.Env == nil {
opts.Env = &Env{}
}
opts.Env.Scriptorium = scriptoriumFake
return executePlan(ctx, cfg, plan, opts)
}
newObjectStoreFromConfigFn = func(context.Context, *config.Config) (storage.ObjectStore, error) {
objectStoreConstructed = true
return nil, context.Canceled
return executePlanWithDependencies(ctx, cfg, plan, opts, invocationDependencies{
newObjectStore: func(context.Context, *config.Config) (storage.ObjectStore, error) {
objectStoreConstructed = true
return nil, context.Canceled
},
})
}
stdout.Reset()