mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 11:07:07 +00:00
perf(test): speed up docker-setup suite
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
|
||||
import { chmod, copyFile, mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
@@ -46,8 +46,8 @@ async function createDockerSetupSandbox(): Promise<DockerSetupSandbox> {
|
||||
const binDir = join(rootDir, "bin");
|
||||
const logPath = join(rootDir, "docker-stub.log");
|
||||
|
||||
const script = await readFile(join(repoRoot, "docker-setup.sh"), "utf8");
|
||||
await writeFile(scriptPath, script, { mode: 0o755 });
|
||||
await copyFile(join(repoRoot, "docker-setup.sh"), scriptPath);
|
||||
await chmod(scriptPath, 0o755);
|
||||
await writeFile(dockerfilePath, "FROM scratch\n");
|
||||
await writeFile(
|
||||
composePath,
|
||||
@@ -95,7 +95,7 @@ describe("docker-setup.sh", () => {
|
||||
OPENCLAW_EXTRA_MOUNTS: undefined,
|
||||
OPENCLAW_HOME_VOLUME: undefined,
|
||||
}),
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
});
|
||||
expect(defaultsResult.status).toBe(0);
|
||||
const defaultsEnvFile = await readFile(join(sandbox.rootDir, ".env"), "utf8");
|
||||
@@ -111,7 +111,7 @@ describe("docker-setup.sh", () => {
|
||||
OPENCLAW_EXTRA_MOUNTS: "",
|
||||
OPENCLAW_HOME_VOLUME: "openclaw-home",
|
||||
}),
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
});
|
||||
expect(aptAndHomeVolumeResult.status).toBe(0);
|
||||
const aptEnvFile = await readFile(join(sandbox.rootDir, ".env"), "utf8");
|
||||
|
||||
Reference in New Issue
Block a user