fix(ci): align tests with runtime barrels

This commit is contained in:
Peter Steinberger
2026-04-27 15:14:53 +01:00
parent 9090457da7
commit 467ee701ef
4 changed files with 4 additions and 2 deletions

View File

@@ -266,8 +266,6 @@ async function monitorWithAutoAbort(opts: Omit<MonitorTelegramOpts, "abortSignal
vi.mock("openclaw/plugin-sdk/runtime-config-snapshot", async () => {
return {
getRuntimeConfig: getRuntimeConfigMock,
resolveAgentMaxConcurrent: (cfg: { agents?: { defaults?: { maxConcurrent?: number } } }) =>
cfg.agents?.defaults?.maxConcurrent ?? 1,
};
});

View File

@@ -22,6 +22,7 @@ vi.mock("openclaw/plugin-sdk/config-mutation", async () => {
...actual,
readConfigFileSnapshotForWrite,
replaceConfigFile,
writeConfigFile,
};
});

View File

@@ -52,6 +52,7 @@ function createCompactionContext(params: {
compactionCount += 1;
},
getCompactionCount: () => compactionCount,
noteCompactionTokensAfter: vi.fn(),
} as unknown as EmbeddedPiSubscribeContext;
}

View File

@@ -59,6 +59,7 @@ describe("compaction hook wiring", () => {
maybeResolveCompactionWait: vi.fn(),
incrementCompactionCount: vi.fn(),
getCompactionCount: () => params.compactionCount ?? 0,
noteCompactionTokensAfter: vi.fn(),
...(params.withRetryHooks
? {
noteCompactionRetry: vi.fn(),
@@ -251,6 +252,7 @@ describe("compaction hook wiring", () => {
maybeResolveCompactionWait: vi.fn(),
getCompactionCount: () => 1,
incrementCompactionCount: vi.fn(),
noteCompactionTokensAfter: vi.fn(),
};
runCompactionEnd(ctx, { willRetry: false, result: { summary: "compacted" } });