惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
V
Visual Studio Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园 - 聂微东
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
博客园 - 司徒正美
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(e2e): isolate kitchen sink log scans · openclaw/openc...
vincentkoc · 2026-05-28 · via Recent Commits to openclaw:main

@@ -1,10 +1,11 @@

11

import { spawnSync } from "node:child_process";

2-

import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";

2+

import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

33

import { tmpdir } from "node:os";

44

import path from "node:path";

55

import { describe, expect, it } from "vitest";

6677

const ASSERTIONS_SCRIPT = "scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs";

8+

const SWEEP_SCRIPT = "scripts/e2e/lib/kitchen-sink-plugin/sweep.sh";

89

const REQUIRED_FULL_DIAGNOSTIC_CANARIES = [

910

"only bundled plugins can register trusted tool policies",

1011

"plugin must declare contracts.tools for: kitchen-sink-tool",

@@ -114,6 +115,17 @@ function runAssertInstalled({

114115

}

115116

}

116117118+

function runScanLogs({ home, scratchRoot }: { home: string; scratchRoot: string }) {

119+

return spawnSync(process.execPath, [ASSERTIONS_SCRIPT, "scan-logs"], {

120+

encoding: "utf8",

121+

env: {

122+

...process.env,

123+

HOME: home,

124+

KITCHEN_SINK_TMP_DIR: scratchRoot,

125+

},

126+

});

127+

}

128+117129

describe("kitchen-sink plugin assertions", () => {

118130

it("fails full-surface installs when stable diagnostic canaries disappear", () => {

119131

const result = runAssertInstalled();

@@ -143,4 +155,74 @@ describe("kitchen-sink plugin assertions", () => {

143155

"cli registration missing explicit commands metadata",

144156

);

145157

});

158+159+

it("scans only the configured kitchen-sink scratch root", () => {

160+

const parent = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-sink-scan-"));

161+

const home = path.join(parent, "home");

162+

const scratchRoot = path.join(parent, "scratch");

163+

const siblingRoot = path.join(parent, "sibling");

164+

try {

165+

mkdirSync(home, { recursive: true });

166+

mkdirSync(scratchRoot, { recursive: true });

167+

mkdirSync(siblingRoot, { recursive: true });

168+

writeFileSync(path.join(scratchRoot, "large.log"), `${"x".repeat(70 * 1024)}\n0 errors\n`);

169+

writeFileSync(path.join(siblingRoot, "stale.log"), "[ERROR] stale sibling failure\n");

170+171+

const result = runScanLogs({ home, scratchRoot });

172+173+

expect(result.status).toBe(0);

174+

expect(result.stdout).toContain("log scan passed");

175+

expect(`${result.stdout}\n${result.stderr}`).not.toContain("stale sibling failure");

176+

} finally {

177+

rmSync(parent, { force: true, recursive: true });

178+

}

179+

});

180+181+

it("bounds repeated kitchen-sink log scan findings", () => {

182+

const parent = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-sink-scan-"));

183+

const home = path.join(parent, "home");

184+

const scratchRoot = path.join(parent, "scratch");

185+

try {

186+

mkdirSync(home, { recursive: true });

187+

mkdirSync(scratchRoot, { recursive: true });

188+

writeFileSync(

189+

path.join(scratchRoot, "errors.log"),

190+

Array.from({ length: 105 }, (_, index) => `[ERROR] failure ${index}`).join("\n"),

191+

);

192+193+

const result = runScanLogs({ home, scratchRoot });

194+195+

expect(result.status).not.toBe(0);

196+

expect(`${result.stdout}\n${result.stderr}`).toContain("additional findings omitted");

197+

expect(`${result.stdout}\n${result.stderr}`).not.toContain("[ERROR] failure 104");

198+

} finally {

199+

rmSync(parent, { force: true, recursive: true });

200+

}

201+

});

202+203+

it("rejects kitchen-sink log scans without an isolated scratch root", () => {

204+

const parent = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-sink-scan-"));

205+

try {

206+

const spawnEnv = { ...process.env, HOME: parent };

207+

delete spawnEnv.KITCHEN_SINK_TMP_DIR;

208+

const result = spawnSync(process.execPath, [ASSERTIONS_SCRIPT, "scan-logs"], {

209+

encoding: "utf8",

210+

env: spawnEnv,

211+

});

212+213+

expect(result.status).not.toBe(0);

214+

expect(`${result.stdout}\n${result.stderr}`).toContain("KITCHEN_SINK_TMP_DIR is required");

215+

} finally {

216+

rmSync(parent, { force: true, recursive: true });

217+

}

218+

});

219+220+

it("allocates an isolated scratch root by default", () => {

221+

const sweep = readFileSync(SWEEP_SCRIPT, "utf8");

222+223+

expect(sweep).toContain('mktemp -d "/tmp/openclaw-kitchen-sink.XXXXXX"');

224+

expect(sweep).toContain('mktemp -d "${KITCHEN_SINK_TMP_DIR}/clawhub.XXXXXX"');

225+

expect(sweep).not.toContain('KITCHEN_SINK_TMP_DIR="${KITCHEN_SINK_TMP_DIR:-/tmp}"');

226+

expect(sweep).not.toContain('mktemp -d "/tmp/openclaw-kitchen-sink-clawhub.XXXXXX"');

227+

});

146228

});