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

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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(qa-lab): accept native Windows paths · openclaw/open...
vincentkoc · 2026-05-05 · via Recent Commits to openclaw:main

@@ -4,7 +4,7 @@ import os from "node:os";

44

import path from "node:path";

55

import { setTimeout as sleep } from "node:timers/promises";

66

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

7-

import { startQaLabServer } from "./lab-server.js";

7+

import { startQaLabServer, type QaLabServerStartParams } from "./lab-server.js";

8899

vi.mock("@openclaw/qa-channel/api.js", async () => await import("../../qa-channel/api.js"));

1010

@@ -128,6 +128,13 @@ vi.mock("openclaw/plugin-sdk/proxy-capture", () => ({

128128129129

const cleanups: Array<() => Promise<void>> = [];

130130131+

async function startQaLabServerForTest(params?: QaLabServerStartParams) {

132+

return await startQaLabServer({

133+

embeddedGateway: "disabled",

134+

...params,

135+

});

136+

}

137+131138

afterEach(async () => {

132139

captureMock.reset();

133140

while (cleanups.length > 0) {

@@ -241,21 +248,22 @@ async function createQaLabRepoRootFixture(params?: {

241248

}

242249243250

describe("qa-lab server", () => {

244-

it("serves bootstrap state and writes a self-check report", async () => {

251+

it("serves bootstrap state and message state", async () => {

245252

const tempDir = await mkdtemp(path.join(os.tmpdir(), "qa-lab-test-"));

246253

cleanups.push(async () => {

247254

await rm(tempDir, { recursive: true, force: true });

248255

});

249256

const outputPath = path.join(tempDir, "self-check.md");

250257

const repoRoot = await createQaLabRepoRootFixture();

251258252-

const lab = await startQaLabServer({

259+

const lab = await startQaLabServerForTest({

253260

host: "127.0.0.1",

254261

port: 0,

255262

outputPath,

256263

repoRoot,

257264

controlUiUrl: "http://127.0.0.1:18789/",

258265

controlUiToken: "qa-token",

266+

embeddedGateway: "disabled",

259267

});

260268

cleanups.push(async () => {

261269

await lab.stop();

@@ -303,11 +311,7 @@ describe("qa-lab server", () => {

303311

};

304312

expect(snapshot.messages.some((message) => message.text === "hello from test")).toBe(true);

305313306-

const result = await lab.runSelfCheck();

307-

expect(result.scenarioResult.status).toBe("pass");

308-

const markdown = await readFile(outputPath, "utf8");

309-

expect(markdown).toContain("Synthetic Slack-class roundtrip");

310-

expect(markdown).toContain("- Status: pass");

314+

await expect(readFile(outputPath, "utf8")).rejects.toThrow();

311315

});

312316313317

it("anchors direct self-check runs under the explicit repo root by default", async () => {

@@ -316,10 +320,11 @@ describe("qa-lab server", () => {

316320

await rm(repoRoot, { recursive: true, force: true });

317321

});

318322319-

const lab = await startQaLabServer({

323+

const lab = await startQaLabServerForTest({

320324

host: "127.0.0.1",

321325

port: 0,

322326

repoRoot,

327+

embeddedGateway: "disabled",

323328

});

324329

cleanups.push(async () => {

325330

await lab.stop();

@@ -331,9 +336,10 @@ describe("qa-lab server", () => {

331336

});

332337333338

it("injects the kickoff task on demand and on startup", async () => {

334-

const autoKickoffLab = await startQaLabServer({

339+

const autoKickoffLab = await startQaLabServerForTest({

335340

host: "127.0.0.1",

336341

port: 0,

342+

embeddedGateway: "disabled",

337343

sendKickoffOnStart: true,

338344

});

339345

cleanups.push(async () => {

@@ -349,9 +355,10 @@ describe("qa-lab server", () => {

349355

true,

350356

);

351357352-

const manualLab = await startQaLabServer({

358+

const manualLab = await startQaLabServerForTest({

353359

host: "127.0.0.1",

354360

port: 0,

361+

embeddedGateway: "disabled",

355362

});

356363

cleanups.push(async () => {

357364

await manualLab.stop();

@@ -402,7 +409,7 @@ describe("qa-lab server", () => {

402409

throw new Error("expected upstream address");

403410

}

404411405-

const lab = await startQaLabServer({

412+

const lab = await startQaLabServerForTest({

406413

host: "127.0.0.1",

407414

port: 0,

408415

advertiseHost: "127.0.0.1",

@@ -445,7 +452,7 @@ describe("qa-lab server", () => {

445452

"utf8",

446453

);

447454448-

const lab = await startQaLabServer({

455+

const lab = await startQaLabServerForTest({

449456

host: "127.0.0.1",

450457

port: 0,

451458

uiDistDir,

@@ -473,7 +480,7 @@ describe("qa-lab server", () => {

473480

"<!doctype html><html><head><title>Temp QA Lab UI</title></head><body>repo-root-ui</body></html>",

474481

});

475482476-

const lab = await startQaLabServer({

483+

const lab = await startQaLabServerForTest({

477484

host: "127.0.0.1",

478485

port: 0,

479486

repoRoot,

@@ -530,7 +537,7 @@ describe("qa-lab server", () => {

530537

"utf8",

531538

);

532539533-

const lab = await startQaLabServer({

540+

const lab = await startQaLabServerForTest({

534541

host: "127.0.0.1",

535542

port: 0,

536543

repoRoot,

@@ -579,7 +586,7 @@ describe("qa-lab server", () => {

579586

"utf8",

580587

);

581588582-

const lab = await startQaLabServer({

589+

const lab = await startQaLabServerForTest({

583590

host: "127.0.0.1",

584591

port: 0,

585592

repoRoot,

@@ -597,11 +604,13 @@ describe("qa-lab server", () => {

597604598605

await lab.stop();

599606

stopped = true;

600-

expect(await waitForFileContent(stoppedPath, "terminated")).toBe("terminated");

607+

if (process.platform !== "win32") {

608+

expect(await waitForFileContent(stoppedPath, "terminated")).toBe("terminated");

609+

}

601610

});

602611603612

it("can disable the embedded echo gateway for real-suite runs", async () => {

604-

const lab = await startQaLabServer({

613+

const lab = await startQaLabServerForTest({

605614

host: "127.0.0.1",

606615

port: 0,

607616

embeddedGateway: "disabled",

@@ -630,7 +639,7 @@ describe("qa-lab server", () => {

630639

});

631640632641

it("exposes structured outcomes and can attach control-ui after startup", async () => {

633-

const lab = await startQaLabServer({

642+

const lab = await startQaLabServerForTest({

634643

host: "127.0.0.1",

635644

port: 0,

636645

embeddedGateway: "disabled",

@@ -776,7 +785,7 @@ describe("qa-lab server", () => {

776785

}),

777786

});

778787779-

const lab = await startQaLabServer({

788+

const lab = await startQaLabServerForTest({

780789

host: "127.0.0.1",

781790

port: 0,

782791

});