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

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
J
Java Code Geeks
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
IT之家
IT之家
博客园_首页
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
B
Blog
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
博客园 - 聂微东
腾讯CDC
A
About on SuperTechFans

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(qa): recover Playwright Chromium on Ubuntu 26 · openc...
vincentkoc · 2026-06-24 · via Recent Commits to openclaw:main

@@ -2,7 +2,9 @@

22

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

33

import {

44

ensurePlaywrightChromium,

5+

installLinuxSystemChromiumPackage,

56

resolvePlaywrightInstallRunner,

7+

shouldEnsureFfmpegFromArgv,

68

shouldInstallPlaywrightSystemDependencies,

79

} from "../../scripts/ensure-playwright-chromium.mjs";

810

@@ -276,6 +278,55 @@ describe("ensurePlaywrightChromium", () => {

276278

expect(logs.join("\n")).toContain("installing Linux system dependencies");

277279

});

278280281+

it("falls back to distro Chromium when Playwright does not support the Linux runner image", () => {

282+

const logs: string[] = [];

283+

let installedSystemChromium = false;

284+

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

285+

if (command === "pnpm" && args.includes("chromium")) {

286+

return { status: 1 };

287+

}

288+

if (command === "apt-get" && args.includes("update")) {

289+

return { status: 0 };

290+

}

291+

if (command === "apt-get" && args.includes("chromium-browser")) {

292+

installedSystemChromium = true;

293+

return { status: 0 };

294+

}

295+

if (command === "/usr/bin/chromium-browser") {

296+

return { status: installedSystemChromium ? 0 : 127 };

297+

}

298+

return { status: 1 };

299+

});

300+301+

expect(

302+

ensurePlaywrightChromium({

303+

cwd: "/repo",

304+

env: { CI: "1", PATH: "/bin" },

305+

executablePath: "/cache/chromium/chrome",

306+

existsSync: (path: string) =>

307+

installedSystemChromium && path === "/usr/bin/chromium-browser",

308+

getuid: () => 0,

309+

log: (line: string) => logs.push(line),

310+

platform: "linux",

311+

spawnSync,

312+

stdio: "pipe",

313+

systemExecutablePath: "",

314+

}),

315+

).toBe(0);

316+

expect(spawnSync).toHaveBeenCalledWith(

317+

"apt-get",

318+

["update", "-qq"],

319+

expect.objectContaining({ cwd: "/repo", stdio: "pipe" }),

320+

);

321+

expect(spawnSync).toHaveBeenCalledWith(

322+

"apt-get",

323+

["install", "-y", "chromium-browser"],

324+

expect.objectContaining({ cwd: "/repo", stdio: "pipe" }),

325+

);

326+

expect(logs.join("\n")).toContain("installing a system Chromium package");

327+

expect(logs.join("\n")).toContain("Using system Chromium at /usr/bin/chromium-browser");

328+

});

329+279330

it("does not install Linux system dependencies for an unprivileged local lane", () => {

280331

const spawnSync = vi

281332

.fn()

@@ -343,6 +394,7 @@ describe("ensurePlaywrightChromium", () => {

343394

ensurePlaywrightChromium({

344395

executablePath: "/cache/chromium/chrome",

345396

existsSync: () => false,

397+

platform: "darwin",

346398

spawnSync: vi.fn(() => ({ status: 23 })),

347399

stdio: "pipe",

348400

systemExecutablePath: "",

@@ -404,4 +456,45 @@ describe("ensurePlaywrightChromium", () => {

404456

}),

405457

).toBe(true);

406458

});

459+460+

it("installs Linux system Chromium packages with sudo for non-root lanes", () => {

461+

const spawnSync = vi.fn(() => ({ status: 0 }));

462+463+

expect(

464+

installLinuxSystemChromiumPackage({

465+

cwd: "/repo",

466+

env: { PATH: "/bin" },

467+

getuid: () => 501,

468+

platform: "linux",

469+

spawnSync,

470+

stdio: "pipe",

471+

}),

472+

).toBe(0);

473+

expect(spawnSync).toHaveBeenNthCalledWith(1, "sudo", ["-n", "true"], { stdio: "ignore" });

474+

expect(spawnSync).toHaveBeenNthCalledWith(

475+

2,

476+

"sudo",

477+

["-n", "apt-get", "update", "-qq"],

478+

expect.objectContaining({ cwd: "/repo", stdio: "pipe" }),

479+

);

480+

expect(spawnSync).toHaveBeenNthCalledWith(

481+

3,

482+

"sudo",

483+

["-n", "apt-get", "install", "-y", "chromium-browser"],

484+

expect.objectContaining({ cwd: "/repo", stdio: "pipe" }),

485+

);

486+

});

487+488+

it("allows QA scenario runners to skip optional Playwright ffmpeg", () => {

489+

expect(shouldEnsureFfmpegFromArgv(["node", "scripts/ensure-playwright-chromium.mjs"])).toBe(

490+

true,

491+

);

492+

expect(

493+

shouldEnsureFfmpegFromArgv([

494+

"node",

495+

"scripts/ensure-playwright-chromium.mjs",

496+

"--skip-ffmpeg",

497+

]),

498+

).toBe(false);

499+

});

407500

});