test(backend): make mgr injectable; assert teardown-before-delete ordering

This commit is contained in:
2026-06-29 12:36:29 +02:00
parent bd29ac517c
commit 387ae56583
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ import { loadSettings, type Settings } from "./settings/settings-store.js";
export interface BuildAppDeps {
thtRunner?: ThtRunner;
mgr?: PiProcessManager;
spawnFn?: () => any;
listModels?: ListModelsFn;
getSettings?: () => Settings;
@@ -34,7 +35,7 @@ export function buildApp(config: AppConfig, deps?: BuildAppDeps): FastifyInstanc
harnessDir: config.harnessDir,
configPath: "config/tht.yaml",
});
const mgr = new PiProcessManager(config, deps?.spawnFn ? { spawnFn: deps.spawnFn } : undefined);
const mgr = deps?.mgr ?? new PiProcessManager(config, deps?.spawnFn ? { spawnFn: deps.spawnFn } : undefined);
const hub = new SseHub();
const listModels = deps?.listModels ?? createPiModelLister(config);