mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
fix(qa): relax Matrix artifact modes on Windows
This commit is contained in:
@@ -77,6 +77,13 @@ async function expectPathMissing(targetPath: string): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
function expectPrivatePosixMode(mode: number, label: string): void {
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
expect(mode & 0o077, `${label} permissions are too broad: ${(mode & 0o777).toString(8)}`).toBe(0);
|
||||
}
|
||||
|
||||
function matrixQaScenarioContext(): MatrixQaScenarioContext {
|
||||
return {
|
||||
baseUrl: "http://127.0.0.1:28008/",
|
||||
@@ -5587,13 +5594,14 @@ describe("matrix live qa scenarios", () => {
|
||||
const cliArtifactDir = path.join(outputDir, "cli-self-verification", cliRunDir ?? "");
|
||||
const cliArtifactMode = (await stat(cliArtifactDir)).mode;
|
||||
expect(typeof cliArtifactMode).toBe("number");
|
||||
expect(cliArtifactMode & 0o777).toBe(0o700);
|
||||
expectPrivatePosixMode(cliArtifactMode, "Matrix QA CLI artifact directory");
|
||||
await expect(
|
||||
readFile(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt"), "utf8"),
|
||||
).resolves.toContain('"success":true');
|
||||
expect(
|
||||
(await stat(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt"))).mode & 0o777,
|
||||
).toBe(0o600);
|
||||
const restoreStdoutMode = (
|
||||
await stat(path.join(cliArtifactDir, "verify-backup-restore.stdout.txt"))
|
||||
).mode;
|
||||
expectPrivatePosixMode(restoreStdoutMode, "Matrix QA CLI restore stdout artifact");
|
||||
await expect(
|
||||
readFile(path.join(cliArtifactDir, "verify-self.stdout.txt"), "utf8"),
|
||||
).resolves.toContain("Device verified by owner: yes");
|
||||
|
||||
Reference in New Issue
Block a user