test(plugins): isolate comment wake scheduling

Allow plugin host tests to inject a heartbeat runtime environment so worktree scheduling suppression cannot replace the wake the test is verifying.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-15 20:19:49 +00:00
1 parent 38012cdf94
commit 6a1ebf63a4
2 files changed
+14 -2

No files matched your search

@@ -862,7 +862,14 @@ describeEmbeddedPostgres("plugin orchestration APIs", () => {
contextSnapshot: {},
});
const services = buildHostServices(db, "plugin-record-id", "paperclip.gateway", createEventBusStub());
const services = buildHostServices(
db,
"plugin-record-id",
"paperclip.gateway",
createEventBusStub(),
undefined,
{ heartbeatRuntimeEnv: {} },
);
const comment = await services.issues.createComment({
issueId,
companyId,
+6 -1
View File
@@ -690,7 +690,11 @@ export function buildHostServices(
pluginKey: string,
eventBus: PluginEventBus,
notifyWorker?: (method: string, params: unknown) => void,
options: { pluginWorkerManager?: PluginWorkerManager; manifest?: import("@paperclipai/shared").PaperclipPluginManifestV1 } = {},
options: {
pluginWorkerManager?: PluginWorkerManager;
manifest?: import("@paperclipai/shared").PaperclipPluginManifestV1;
heartbeatRuntimeEnv?: Record<string, string | undefined>;
} = {},
): HostServices & { dispose(): void } {
const registry = pluginRegistryService(db);
const stateStore = pluginStateStore(db);
@@ -730,6 +734,7 @@ export function buildHostServices(
});
const heartbeat = heartbeatService(db, {
pluginWorkerManager: options.pluginWorkerManager,
runtimeEnv: options.heartbeatRuntimeEnv,
});
const projects = projectService(db);
const executionWorkspaces = executionWorkspaceService(db);