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

推荐订阅源

雷峰网
雷峰网
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
博客园_首页
J
Java Code Geeks
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
量子位
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
B
Blog
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI

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
test: tighten tailscale command assertions · openclaw/ope...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -12,7 +12,7 @@ const {

1212

ensureFunnel,

1313

tailscaleFunnelStatusCoversPort,

1414

} = tailscale;

15-

const tailscaleBin = expect.stringMatching(/tailscale$/i);

15+

const tailscaleBin = "tailscale";

16161717

function createRuntimeWithExitError() {

1818

return {

@@ -24,11 +24,23 @@ function createRuntimeWithExitError() {

2424

};

2525

}

262627-

function expectServeFallbackCommand(params: { callArgs: string[]; sudoArgs: string[] }) {

28-

return [

29-

[tailscaleBin, expect.arrayContaining(params.callArgs)],

30-

["sudo", expect.arrayContaining(["-n", tailscaleBin, ...params.sudoArgs])],

31-

];

27+

function expectExecCall(

28+

exec: ReturnType<typeof vi.fn>,

29+

callNumber: number,

30+

command: string,

31+

args: readonly string[],

32+

options?: Record<string, unknown>,

33+

) {

34+

const call = exec.mock.calls[callNumber - 1];

35+

expect(call, `call ${callNumber}`).toBeDefined();

36+

expect(call[0]).toBe(command);

37+

expect(call[1]).toEqual(args);

38+

if (options) {

39+

expect(call).toHaveLength(3);

40+

expect(call[2]).toEqual(options);

41+

} else {

42+

expect(call).toHaveLength(2);

43+

}

3244

}

33453446

describe("tailscale helpers", () => {

@@ -142,12 +154,15 @@ describe("tailscale helpers", () => {

142154143155

await enableTailscaleServe(3000, exec as never);

144156145-

const [firstCall, secondCall] = expectServeFallbackCommand({

146-

callArgs: ["serve", "--bg", "--yes", "3000"],

147-

sudoArgs: ["serve", "--bg", "--yes", "3000"],

157+

expect(exec).toHaveBeenCalledTimes(2);

158+

expectExecCall(exec, 1, tailscaleBin, ["serve", "--bg", "--yes", "3000"], {

159+

maxBuffer: 200_000,

160+

timeoutMs: 15_000,

161+

});

162+

expectExecCall(exec, 2, "sudo", ["-n", tailscaleBin, "serve", "--bg", "--yes", "3000"], {

163+

maxBuffer: 200_000,

164+

timeoutMs: 15_000,

148165

});

149-

expect(exec).toHaveBeenNthCalledWith(1, firstCall[0], firstCall[1], expect.any(Object));

150-

expect(exec).toHaveBeenNthCalledWith(2, secondCall[0], secondCall[1], expect.any(Object));

151166

});

152167153168

it("enableTailscaleServe does NOT use sudo if first attempt succeeds", async () => {

@@ -156,11 +171,10 @@ describe("tailscale helpers", () => {

156171

await enableTailscaleServe(3000, exec as never);

157172158173

expect(exec).toHaveBeenCalledTimes(1);

159-

expect(exec).toHaveBeenCalledWith(

160-

tailscaleBin,

161-

expect.arrayContaining(["serve", "--bg", "--yes", "3000"]),

162-

expect.any(Object),

163-

);

174+

expectExecCall(exec, 1, tailscaleBin, ["serve", "--bg", "--yes", "3000"], {

175+

maxBuffer: 200_000,

176+

timeoutMs: 15_000,

177+

});

164178

});

165179166180

it("disableTailscaleServe uses fallback", async () => {

@@ -172,12 +186,10 @@ describe("tailscale helpers", () => {

172186

await disableTailscaleServe(exec as never);

173187174188

expect(exec).toHaveBeenCalledTimes(2);

175-

expect(exec).toHaveBeenNthCalledWith(

176-

2,

177-

"sudo",

178-

expect.arrayContaining(["-n", tailscaleBin, "serve", "reset"]),

179-

expect.any(Object),

180-

);

189+

expectExecCall(exec, 2, "sudo", ["-n", tailscaleBin, "serve", "reset"], {

190+

maxBuffer: 200_000,

191+

timeoutMs: 15_000,

192+

});

181193

});

182194183195

it("ensureFunnel uses fallback for enabling", async () => {

@@ -196,23 +208,16 @@ describe("tailscale helpers", () => {

196208197209

await ensureFunnel(8080, exec as never, runtime, prompt);

198210199-

expect(exec).toHaveBeenNthCalledWith(

200-

1,

201-

tailscaleBin,

202-

expect.arrayContaining(["funnel", "status", "--json"]),

203-

);

204-

expect(exec).toHaveBeenNthCalledWith(

205-

2,

206-

tailscaleBin,

207-

expect.arrayContaining(["funnel", "--yes", "--bg", "8080"]),

208-

expect.any(Object),

209-

);

210-

expect(exec).toHaveBeenNthCalledWith(

211-

3,

212-

"sudo",

213-

expect.arrayContaining(["-n", tailscaleBin, "funnel", "--yes", "--bg", "8080"]),

214-

expect.any(Object),

215-

);

211+

expect(exec).toHaveBeenCalledTimes(3);

212+

expectExecCall(exec, 1, tailscaleBin, ["funnel", "status", "--json"]);

213+

expectExecCall(exec, 2, tailscaleBin, ["funnel", "--yes", "--bg", "8080"], {

214+

maxBuffer: 200_000,

215+

timeoutMs: 15_000,

216+

});

217+

expectExecCall(exec, 3, "sudo", ["-n", tailscaleBin, "funnel", "--yes", "--bg", "8080"], {

218+

maxBuffer: 200_000,

219+

timeoutMs: 15_000,

220+

});

216221

});

217222218223

it("enableTailscaleServe skips sudo on non-permission errors", async () => {