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

推荐订阅源

宝玉的分享
宝玉的分享
小众软件
小众软件
J
Java Code Geeks
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
L
LangChain Blog
博客园 - 司徒正美
量子位
Y
Y Combinator Blog
C
Check Point Blog
T
Tailwind CSS Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志

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(testing): normalize QA compose service lookup · openc...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -298,6 +298,49 @@ describe("plugin-sdk qa-runtime", () => {

298298

expect(sleepImpl).toHaveBeenCalledTimes(1);

299299

});

300300
301+

it("normalizes multiline Docker compose service lookup output", async () => {

302+

const module = await import("./qa-runtime.js");

303+

const runtime = module.createQaDockerRuntime({ auditContext: "qa-test" });

304+

const runCommand = vi.fn(async (command: string, args: string[], cwd: string) => {

305+

expect(command).toBe("docker");

306+

expect(cwd).toBe("/repo");

307+
308+

if (args.includes("ps") && args.includes("-q")) {

309+

return {

310+

stdout: "\nqa-gateway-one\nqa-gateway-two\n",

311+

stderr: "",

312+

};

313+

}

314+
315+

if (args[0] === "inspect") {

316+

expect(args.at(-1)).toBe("qa-gateway-one");

317+

return {

318+

stdout: "\n172.18.0.4\n172.19.0.4\n",

319+

stderr: "",

320+

};

321+

}

322+
323+

throw new Error(`unexpected docker args: ${args.join(" ")}`);

324+

});

325+

const fetchImpl = vi.fn(async (url: string) => ({

326+

ok: url === "http://172.18.0.4:18789/healthz",

327+

}));

328+
329+

await expect(

330+

runtime.resolveComposeServiceUrl(

331+

"gateway",

332+

18789,

333+

"/tmp/docker-compose.yml",

334+

"/repo",

335+

runCommand,

336+

fetchImpl,

337+

),

338+

).resolves.toBe("http://172.18.0.4:18789/");

339+
340+

expect(runCommand).toHaveBeenCalledTimes(2);

341+

expect(fetchImpl).toHaveBeenCalledWith("http://172.18.0.4:18789/healthz");

342+

});

343+
301344

it("resolves an unpinned QA Docker host port away from an occupied loopback default", async () => {

302345

const module = await import("./qa-runtime.js");

303346

const reservation = await occupyLoopbackPort();

Original file line numberDiff line numberDiff line change

@@ -458,6 +458,10 @@ function normalizeDockerServiceStatus(row?: { Health?: string; State?: string })

458458

return "unknown";

459459

}

460460
461+

function firstDockerOutputLine(stdout: string) {

462+

return normalizeStringEntries(stdout.split("\n"))[0] ?? "";

463+

}

464+
461465

function parseDockerComposePsRows(stdout: string) {

462466

const trimmed = stdout.trim();

463467

if (!trimmed) {

@@ -620,7 +624,7 @@ export function createQaDockerRuntime(params: {

620624

["compose", "-f", composeFile, "ps", "-q", service],

621625

repoRoot,

622626

);

623-

const containerId = containerStdout.trim();

627+

const containerId = firstDockerOutputLine(containerStdout);

624628

if (!containerId) {

625629

return null;

626630

}

@@ -629,12 +633,12 @@ export function createQaDockerRuntime(params: {

629633

[

630634

"inspect",

631635

"--format",

632-

"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}",

636+

"{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}",

633637

containerId,

634638

],

635639

repoRoot,

636640

);

637-

const ip = ipStdout.trim();

641+

const ip = firstDockerOutputLine(ipStdout);

638642

if (!ip) {

639643

return null;

640644

}