fix(ci): restore capture and maintenance regression checks

This commit is contained in:
N0zoM1z0
2026-10-10 16:34:17 +00:00
parent 6d8f95e38d
commit 69485e27f7
13 changed files with 127 additions and 51 deletions
+29 -6
View File
@@ -148,6 +148,7 @@ describe("existing REA integration maintenance", () => {
).resolves.toEqual({
clients: ["codex", "vscode"],
skill: false,
skillDestinations: [],
});
});
@@ -157,6 +158,7 @@ describe("existing REA integration maintenance", () => {
).resolves.toEqual({
clients: [],
skill: false,
skillDestinations: [],
});
await writeSkill("---\nname: another-skill\n---\nUser-authored content\n");
await expect(
@@ -164,6 +166,7 @@ describe("existing REA integration maintenance", () => {
).resolves.toEqual({
clients: [],
skill: false,
skillDestinations: [],
});
});
@@ -177,6 +180,7 @@ describe("existing REA integration maintenance", () => {
).resolves.toEqual({
clients: [],
skill: true,
skillDestinations: [{ client: "shared", path: dirname(path) }],
});
expect(await readFile(path, "utf8")).toBe(original);
});
@@ -224,7 +228,7 @@ describe("existing REA integration maintenance", () => {
]);
expect(result).toEqual({
status: "planned",
scope: { clients: ["codex"], skill: false },
scope: { clients: ["codex"], skill: false, skillDestinations: [] },
command: recorded[0]?.slice(0, -2),
plannedActions: [action],
});
@@ -273,6 +277,8 @@ describe("updated executable maintenance planning", () => {
it("runs real setup as a noninteractive dry run and creates no new integrations or backups", async () => {
const configPath = await writeClient("codex", staleCodex);
const untouched = await writeClient("claude_code", '{"mcpServers":{}}');
const skillContent = `---\nname: ${PRODUCT_IDENTITY.skillName}\nmetadata:\n version: "1"\n---\n# REA\n`;
const skillPath = await writeSkill(skillContent);
vi.stubEnv("npm_command", "exec");
const result = await planIntegrationMaintenance(
home,
@@ -282,18 +288,35 @@ describe("updated executable maintenance planning", () => {
);
expect(result).toMatchObject({
status: "planned",
scope: { clients: ["codex"], skill: false },
plannedActions: [
{ id: "configure_client:codex", kind: "configure_client" },
],
scope: {
clients: ["codex"],
skill: true,
skillDestinations: [{ client: "shared", path: dirname(skillPath) }],
},
});
if (result.status !== "planned") throw new Error(JSON.stringify(result));
expect(result.plannedActions).toEqual([
expect.objectContaining({
id: "configure_client:codex",
kind: "configure_client",
}),
expect.objectContaining({
id: "install_skill",
kind: "install_skill",
target: dirname(skillPath),
}),
]);
expect(await readFile(configPath, "utf8")).toBe(staleCodex);
expect(await readFile(untouched, "utf8")).toBe('{"mcpServers":{}}');
expect(await readFile(skillPath, "utf8")).toBe(skillContent);
await expect(access(`${configPath}.rea.backup`)).rejects.toMatchObject({
code: "ENOENT",
});
await expect(access(`${skillPath}.rea.backup`)).rejects.toMatchObject({
code: "ENOENT",
});
await expect(
access(join(home, ".agents", "skills", PRODUCT_IDENTITY.skillName)),
access(join(home, ".claude", "skills", PRODUCT_IDENTITY.skillName)),
).rejects.toMatchObject({ code: "ENOENT" });
});
});