mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:11:24 +00:00
test: speed up isolated-agent and pty test suites
This commit is contained in:
@@ -166,6 +166,8 @@ vi.mock("../../agents/defaults.js", () => ({
|
||||
DEFAULT_PROVIDER: "openai",
|
||||
}));
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
// ---------- helpers ----------
|
||||
|
||||
function makeJob(overrides?: Record<string, unknown>) {
|
||||
@@ -230,8 +232,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
it("passes agent-level skillFilter to buildWorkspaceSkillSnapshot", async () => {
|
||||
resolveAgentSkillsFilterMock.mockReturnValue(["meme-factory", "weather"]);
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
const result = await runCronIsolatedAgentTurn(
|
||||
makeParams({
|
||||
cfg: { agents: { list: [{ id: "scout", skills: ["meme-factory", "weather"] }] } },
|
||||
@@ -250,8 +250,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
it("omits skillFilter when agent has no skills config", async () => {
|
||||
resolveAgentSkillsFilterMock.mockReturnValue(undefined);
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
const result = await runCronIsolatedAgentTurn(
|
||||
makeParams({
|
||||
cfg: { agents: { list: [{ id: "general" }] } },
|
||||
@@ -268,8 +266,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
it("passes empty skillFilter when agent explicitly disables all skills", async () => {
|
||||
resolveAgentSkillsFilterMock.mockReturnValue([]);
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
const result = await runCronIsolatedAgentTurn(
|
||||
makeParams({
|
||||
cfg: { agents: { list: [{ id: "silent", skills: [] }] } },
|
||||
@@ -302,8 +298,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
isNewSession: true,
|
||||
});
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
const result = await runCronIsolatedAgentTurn(
|
||||
makeParams({
|
||||
cfg: { agents: { list: [{ id: "weather-bot", skills: ["weather"] }] } },
|
||||
@@ -338,8 +332,6 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
isNewSession: true,
|
||||
});
|
||||
|
||||
const { runCronIsolatedAgentTurn } = await import("./run.js");
|
||||
|
||||
const result = await runCronIsolatedAgentTurn(
|
||||
makeParams({
|
||||
cfg: { agents: { list: [{ id: "weather-bot", skills: ["weather", "meme-factory"] }] } },
|
||||
|
||||
Reference in New Issue
Block a user