test(agents): reuse inherited auth owner harness (#129507)

This commit is contained in:
Peter Steinberger
2026-08-25 11:22:54 -07:00
committed by GitHub
parent 131d1f9b35
commit 4b44cfce5f
@@ -1,5 +1,5 @@
import path from "node:path";
import { describe, expect, it } from "vitest";
import { beforeEach, describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { listAgentIds } from "../agent-scope-config.js";
import { makeAttemptResult } from "./run.overflow-compaction.fixture.js";
@@ -9,8 +9,11 @@ import {
mockedBuildEmbeddedRunPayloads,
mockedRunEmbeddedAttempt,
overflowBaseRunParams,
resetSharedRunIntegrationHarnessMocks,
} from "./run.overflow-compaction.harness.js";
const { runEmbeddedAgent } = await loadRunOverflowCompactionHarness();
function projectSetupExecutionConfig(source: OpenClawConfig): OpenClawConfig {
return {
...source,
@@ -25,6 +28,8 @@ function projectSetupExecutionConfig(source: OpenClawConfig): OpenClawConfig {
}
describe("embedded setup inference inherited auth owner", () => {
beforeEach(resetSharedRunIntegrationHarnessMocks);
it.each([
{ name: "a pre-roster config", source: {} },
{ name: "a sole-agent config", source: { agents: { entries: { main: {} } } } },
@@ -34,7 +39,6 @@ describe("embedded setup inference inherited auth owner", () => {
const config = projectSetupExecutionConfig(source);
expect(listAgentIds(config)).toEqual(["main", "openclaw"]);
const { runEmbeddedAgent } = await loadRunOverflowCompactionHarness();
mockedBuildEmbeddedRunPayloads.mockReturnValue([{ text: "OK" }]);
mockedRunEmbeddedAttempt.mockResolvedValueOnce(makeAttemptResult({ assistantTexts: ["OK"] }));