mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 17:01:53 +03:00
perf(test): speed up docker-setup and web media fallback
This commit is contained in:
@@ -88,34 +88,20 @@ describe("docker-setup.sh", () => {
|
||||
it("handles env defaults, home-volume mounts, and apt build args", async () => {
|
||||
const sandbox = await createDockerSetupSandbox();
|
||||
|
||||
const defaultsResult = spawnSync("bash", [sandbox.scriptPath], {
|
||||
cwd: sandbox.rootDir,
|
||||
env: createEnv(sandbox, {
|
||||
OPENCLAW_DOCKER_APT_PACKAGES: undefined,
|
||||
OPENCLAW_EXTRA_MOUNTS: undefined,
|
||||
OPENCLAW_HOME_VOLUME: undefined,
|
||||
}),
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
});
|
||||
expect(defaultsResult.status).toBe(0);
|
||||
const defaultsEnvFile = await readFile(join(sandbox.rootDir, ".env"), "utf8");
|
||||
expect(defaultsEnvFile).toContain("OPENCLAW_DOCKER_APT_PACKAGES=");
|
||||
expect(defaultsEnvFile).toContain("OPENCLAW_EXTRA_MOUNTS=");
|
||||
expect(defaultsEnvFile).toContain("OPENCLAW_HOME_VOLUME=");
|
||||
|
||||
await writeFile(sandbox.logPath, "");
|
||||
const aptAndHomeVolumeResult = spawnSync("bash", [sandbox.scriptPath], {
|
||||
const result = spawnSync("bash", [sandbox.scriptPath], {
|
||||
cwd: sandbox.rootDir,
|
||||
env: createEnv(sandbox, {
|
||||
OPENCLAW_DOCKER_APT_PACKAGES: "ffmpeg build-essential",
|
||||
OPENCLAW_EXTRA_MOUNTS: "",
|
||||
OPENCLAW_EXTRA_MOUNTS: undefined,
|
||||
OPENCLAW_HOME_VOLUME: "openclaw-home",
|
||||
}),
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
});
|
||||
expect(aptAndHomeVolumeResult.status).toBe(0);
|
||||
const aptEnvFile = await readFile(join(sandbox.rootDir, ".env"), "utf8");
|
||||
expect(aptEnvFile).toContain("OPENCLAW_DOCKER_APT_PACKAGES=ffmpeg build-essential");
|
||||
expect(result.status).toBe(0);
|
||||
const envFile = await readFile(join(sandbox.rootDir, ".env"), "utf8");
|
||||
expect(envFile).toContain("OPENCLAW_DOCKER_APT_PACKAGES=ffmpeg build-essential");
|
||||
expect(envFile).toContain("OPENCLAW_EXTRA_MOUNTS=");
|
||||
expect(envFile).toContain("OPENCLAW_HOME_VOLUME=openclaw-home");
|
||||
const extraCompose = await readFile(join(sandbox.rootDir, "docker-compose.extra.yml"), "utf8");
|
||||
expect(extraCompose).toContain("openclaw-home:/home/node");
|
||||
expect(extraCompose).toContain("volumes:");
|
||||
|
||||
Reference in New Issue
Block a user