mirror of https://github.com/openclaw/openclaw.git
test(ci): fix windows update and task cleanup cases
This commit is contained in:
parent
9f132fc1b0
commit
be1d31fa8a
|
|
@ -751,7 +751,6 @@ describe("update-cli", () => {
|
|||
const brewRoot = path.join(brewPrefix, "lib", "node_modules");
|
||||
const pkgRoot = path.join(brewRoot, "openclaw");
|
||||
const brewNpm = path.join(brewPrefix, "bin", "npm");
|
||||
const win32PrefixNpm = path.join(brewPrefix, "npm.cmd");
|
||||
const pathNpmRoot = createCaseDir("nvm-root");
|
||||
mockPackageInstallStatus(pkgRoot);
|
||||
pathExists.mockResolvedValue(false);
|
||||
|
|
@ -809,15 +808,24 @@ describe("update-cli", () => {
|
|||
.mock.calls.find(
|
||||
([argv]) =>
|
||||
Array.isArray(argv) &&
|
||||
[path.normalize(brewNpm), path.normalize(win32PrefixNpm)].includes(
|
||||
path.normalize(String(argv[0] ?? "")),
|
||||
) &&
|
||||
argv[1] === "i" &&
|
||||
argv[2] === "-g" &&
|
||||
argv[3] === "openclaw@latest",
|
||||
);
|
||||
|
||||
expect(installCall).toBeDefined();
|
||||
const installCommand = String(installCall?.[0][0] ?? "");
|
||||
expect(installCommand).not.toBe("npm");
|
||||
expect(path.isAbsolute(installCommand)).toBe(true);
|
||||
expect(path.normalize(installCommand)).toContain(path.normalize(brewPrefix));
|
||||
expect(path.normalize(installCommand)).toMatch(
|
||||
new RegExp(
|
||||
`${path
|
||||
.normalize(path.join(brewPrefix, path.sep))
|
||||
.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}.*npm(?:\\.cmd)?$`,
|
||||
"i",
|
||||
),
|
||||
);
|
||||
expect(installCall?.[1]).toEqual(
|
||||
expect.objectContaining({
|
||||
timeoutMs: expect.any(Number),
|
||||
|
|
|
|||
|
|
@ -317,6 +317,10 @@ describe("task-executor", () => {
|
|||
ownerKey: "agent:main:main",
|
||||
controllerId: "tests/managed-flow",
|
||||
goal: "Inspect PR batch",
|
||||
requesterOrigin: {
|
||||
channel: "telegram",
|
||||
to: "telegram:123",
|
||||
},
|
||||
});
|
||||
const child = createRunningTaskRun({
|
||||
runtime: "acp",
|
||||
|
|
|
|||
Loading…
Reference in New Issue