evOo-local/packages/testkit/src/computer-image-tools.test.ts
Cursor Agent 695d024f9c
Fix CI: executor space mocks, optional image tools test, i18n catalogs
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
2026-10-07 21:41:56 +00:00

36 lines
1.0 KiB
TypeScript

import { execFileSync } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const script = path.join(
path.dirname(fileURLToPath(import.meta.url)),
"../../../infra/sandboxes/computer/computer-image-tools.test.sh",
);
function dockerImagePresent(image: string): boolean {
try {
execFileSync("docker", ["image", "inspect", image], { stdio: "ignore" });
return true;
} catch {
return false;
}
}
describe("rakazo/computer image tooling", () => {
it("includes git, gh, ssh, curl, and sudo when the image is built locally", () => {
if (process.env.RAKAZO_COMPUTER_IMAGE_TOOLS_TEST !== "1") {
return;
}
const image = process.env.RAKAZO_COMPUTER_IMAGE ?? "rakazo/computer:local";
if (!dockerImagePresent(image)) {
return;
}
execFileSync("bash", [script], {
env: { ...process.env, RAKAZO_COMPUTER_IMAGE: image },
stdio: "inherit",
});
expect(true).toBe(true);
});
});