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

推荐订阅源

Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
爱范儿
爱范儿
博客园_首页
博客园 - 聂微东
量子位
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
The Cloudflare Blog
T
Tailwind CSS Blog
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC

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(test): fail empty extension test requests · openclaw/...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -1,4 +1,4 @@

1-

import { execFileSync } from "node:child_process";

1+

import { execFileSync, spawnSync } from "node:child_process";

22

import path from "node:path";

33

import { bundledPluginFile, bundledPluginRoot } from "openclaw/plugin-sdk/test-fixtures";

44

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

@@ -38,6 +38,13 @@ function runScript(args: string[], cwd = process.cwd()) {

3838

});

3939

}

404041+

function runScriptResult(args: string[], cwd = process.cwd()) {

42+

return spawnSync(process.execPath, [scriptPath, ...args], {

43+

cwd,

44+

encoding: "utf8",

45+

});

46+

}

47+4148

function requireFirstMockArg<T>(mock: { mock: { calls: Array<[T, ...unknown[]]> } }): T {

4249

const [call] = mock.mock.calls;

4350

if (!call) {

@@ -461,6 +468,21 @@ describe("scripts/test-extension.mjs", () => {

461468

]);

462469

});

463470471+

it("keeps explicitly requested extensions without tests in batch plans", () => {

472+

const extensionId = findExtensionWithoutTests();

473+

const batch = resolveExtensionBatchPlan({

474+

cwd: process.cwd(),

475+

extensionIds: [extensionId, "firecrawl"],

476+

});

477+478+

expect(batch.extensionIds).toEqual([extensionId, "firecrawl"].toSorted());

479+

expect(batch.extensionCount).toBe(2);

480+

expect(batch.noTestExtensionIds).toEqual([extensionId]);

481+

expect(batch.hasTests).toBe(true);

482+

expect(batch.testFileCount).toBe(1);

483+

expect(batch.planGroups.flatMap((group) => group.extensionIds)).toEqual(["firecrawl"]);

484+

});

485+464486

it("counts tracked extension tests without walking extension directories", () => {

465487

const payload = expectNoNodeFsScans<{

466488

batchTests: number;

@@ -657,6 +679,35 @@ describe("scripts/test-extension.mjs", () => {

657679

expect(runParams.targets).toContain("extensions/codex/src/app-server/client.test.ts");

658680

});

659681682+

it("fails extension batch groups when exact excludes remove every test", async () => {

683+

const runGroup = vi.fn<() => Promise<number>>().mockResolvedValue(0);

684+

const result = await runExtensionBatchPlan(

685+

resolveExtensionBatchPlan({ cwd: process.cwd(), extensionIds: ["firecrawl"] }),

686+

{

687+

runGroup,

688+

vitestArgs: ["--exclude", bundledPluginFile("firecrawl", "src/firecrawl-tools.test.ts")],

689+

},

690+

);

691+692+

expect(result).toBe(1);

693+

expect(runGroup).not.toHaveBeenCalled();

694+

});

695+696+

it("allows extension batch groups to opt into empty exact excludes", async () => {

697+

const runGroup = vi.fn<() => Promise<number>>().mockResolvedValue(0);

698+

const result = await runExtensionBatchPlan(

699+

resolveExtensionBatchPlan({ cwd: process.cwd(), extensionIds: ["firecrawl"] }),

700+

{

701+

allowEmptyAfterExclude: true,

702+

runGroup,

703+

vitestArgs: ["--exclude", bundledPluginFile("firecrawl", "src/firecrawl-tools.test.ts")],

704+

},

705+

);

706+707+

expect(result).toBe(0);

708+

expect(runGroup).not.toHaveBeenCalled();

709+

});

710+660711

it("detects exact Vitest excludes in extension batch args", () => {

661712

expect([

662713

...parseExactVitestExcludePaths([

@@ -667,11 +718,19 @@ describe("scripts/test-extension.mjs", () => {

667718

expect([...parseExactVitestExcludePaths(["--exclude=extensions/**/*.test.ts"])]).toEqual([]);

668719

});

669720670-

it("treats extensions without tests as a no-op by default", () => {

721+

it("fails explicitly requested extensions without tests by default", () => {

722+

const extensionId = findExtensionWithoutTests();

723+

const result = runScriptResult([extensionId]);

724+725+

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

726+

expect(result.stderr).toContain(`No tests found for ${bundledPluginRoot(extensionId)}.`);

727+

});

728+729+

it("allows explicitly requested extensions without tests when requested", () => {

671730

const extensionId = findExtensionWithoutTests();

672-

const stdout = runScript([extensionId]);

731+

const result = runScriptResult([extensionId, "--allow-no-tests"]);

673732674-

expect(stdout).toContain(`No tests found for ${bundledPluginRoot(extensionId)}.`);

675-

expect(stdout).toContain("Skipping.");

733+

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

734+

expect(result.stderr).toContain(`No tests found for ${bundledPluginRoot(extensionId)}.`);

676735

});

677736

});