mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:30:42 +00:00
perf: trim sandbox context tests
This commit is contained in:
@@ -19,6 +19,10 @@ vi.mock("./sandbox/prune.js", () => ({
|
||||
maybePruneSandboxes: vi.fn(async () => undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./sandbox/registry.js", () => ({
|
||||
updateRegistry: vi.fn(async () => undefined),
|
||||
}));
|
||||
|
||||
describe("sandbox skill mirroring", () => {
|
||||
let envSnapshot: ReturnType<typeof captureEnv>;
|
||||
let tempRoot = "";
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { registerSandboxBackend } from "./sandbox/backend.js";
|
||||
import { ensureSandboxWorkspaceForSession, resolveSandboxContext } from "./sandbox/context.js";
|
||||
|
||||
const updateRegistryMock = vi.hoisted(() => vi.fn());
|
||||
|
||||
vi.mock("./sandbox/registry.js", () => ({
|
||||
updateRegistry: updateRegistryMock,
|
||||
}));
|
||||
|
||||
describe("resolveSandboxContext", () => {
|
||||
it("does not sandbox the agent main session in non-main mode", async () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
@@ -111,6 +117,7 @@ describe("resolveSandboxContext", () => {
|
||||
mode: "all",
|
||||
backend: "test-backend",
|
||||
scope: "session",
|
||||
workspaceAccess: "rw",
|
||||
prune: { idleHours: 0, maxAgeDays: 0 },
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user