test: stabilize doctor + sandbox tests
This commit is contained in:
@@ -130,41 +130,33 @@ describe("sandbox skill mirroring", () => {
|
|||||||
return { context, workspaceDir };
|
return { context, workspaceDir };
|
||||||
};
|
};
|
||||||
|
|
||||||
it(
|
it("copies skills into the sandbox when workspaceAccess is ro", async () => {
|
||||||
"copies skills into the sandbox when workspaceAccess is ro",
|
const { context } = await runContext("ro");
|
||||||
async () => {
|
|
||||||
const { context } = await runContext("ro");
|
|
||||||
|
|
||||||
expect(context?.enabled).toBe(true);
|
expect(context?.enabled).toBe(true);
|
||||||
const skillPath = path.join(
|
const skillPath = path.join(
|
||||||
context?.workspaceDir ?? "",
|
context?.workspaceDir ?? "",
|
||||||
"skills",
|
"skills",
|
||||||
"demo-skill",
|
"demo-skill",
|
||||||
"SKILL.md",
|
"SKILL.md",
|
||||||
);
|
);
|
||||||
await expect(fs.readFile(skillPath, "utf-8")).resolves.toContain(
|
await expect(fs.readFile(skillPath, "utf-8")).resolves.toContain(
|
||||||
"demo-skill",
|
"demo-skill",
|
||||||
);
|
);
|
||||||
},
|
}, 20_000);
|
||||||
20_000,
|
|
||||||
);
|
|
||||||
|
|
||||||
it(
|
it("copies skills into the sandbox when workspaceAccess is none", async () => {
|
||||||
"copies skills into the sandbox when workspaceAccess is none",
|
const { context } = await runContext("none");
|
||||||
async () => {
|
|
||||||
const { context } = await runContext("none");
|
|
||||||
|
|
||||||
expect(context?.enabled).toBe(true);
|
expect(context?.enabled).toBe(true);
|
||||||
const skillPath = path.join(
|
const skillPath = path.join(
|
||||||
context?.workspaceDir ?? "",
|
context?.workspaceDir ?? "",
|
||||||
"skills",
|
"skills",
|
||||||
"demo-skill",
|
"demo-skill",
|
||||||
"SKILL.md",
|
"SKILL.md",
|
||||||
);
|
);
|
||||||
await expect(fs.readFile(skillPath, "utf-8")).resolves.toContain(
|
await expect(fs.readFile(skillPath, "utf-8")).resolves.toContain(
|
||||||
"demo-skill",
|
"demo-skill",
|
||||||
);
|
);
|
||||||
},
|
}, 20_000);
|
||||||
20_000,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -635,17 +635,15 @@ describe("doctor", () => {
|
|||||||
await doctorCommand(runtime, { nonInteractive: true });
|
await doctorCommand(runtime, { nonInteractive: true });
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
note.mock.calls.some(
|
note.mock.calls.some(([message, title]) => {
|
||||||
([message, title]) => {
|
if (title !== "Sandbox") return false;
|
||||||
if (title !== "Sandbox") return false;
|
if (typeof message !== "string") return false;
|
||||||
if (typeof message !== "string") return false;
|
const normalized = message.replace(/\s+/g, " ");
|
||||||
const normalized = message.replace(/\s+/g, " ");
|
return (
|
||||||
return (
|
normalized.includes('agents.list (id "work") sandbox docker') &&
|
||||||
normalized.includes('agents.list (id "work") sandbox docker') &&
|
normalized.includes('scope resolves to "shared"')
|
||||||
normalized.includes('scope resolves to "shared"')
|
);
|
||||||
);
|
}),
|
||||||
},
|
|
||||||
),
|
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user