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

推荐订阅源

Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
罗磊的独立博客
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
J
Java Code Geeks
L
LangChain Blog
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog

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): route release script owners · openclaw/opencla...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
1+

// Plugin release pretag pack check tests cover its script-local target and command routing.

2+

import { mkdirSync, writeFileSync } from "node:fs";

3+

import { join } from "node:path";

4+

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

5+

import { OPENCLAW_PLUGIN_NPM_REPOSITORY_URL } from "../../scripts/lib/plugin-npm-release.ts";

6+

import {

7+

collectPluginReleasePretagPackTargets,

8+

runPluginReleasePretagPackCheck,

9+

} from "../../scripts/plugin-release-pretag-pack-check.ts";

10+

import { cleanupTempDirs, makeTempRepoRoot, writeJsonFile } from "../helpers/temp-repo.js";

11+12+

const { execFileSyncMock } = vi.hoisted(() => ({

13+

execFileSyncMock: vi.fn(),

14+

}));

15+16+

vi.mock("node:child_process", async () => {

17+

const actual = await vi.importActual<typeof import("node:child_process")>("node:child_process");

18+

return {

19+

...actual,

20+

execFileSync: execFileSyncMock,

21+

};

22+

});

23+24+

const tempDirs: string[] = [];

25+26+

type ExecOptions = {

27+

cwd?: string;

28+

env?: NodeJS.ProcessEnv;

29+

stdio?: unknown;

30+

};

31+32+

afterEach(() => {

33+

cleanupTempDirs(tempDirs);

34+

execFileSyncMock.mockReset();

35+

});

36+37+

function createDualPublishPluginRepo() {

38+

const repoDir = makeTempRepoRoot(tempDirs, "openclaw-plugin-pretag-pack-");

39+

const packageDir = join(repoDir, "extensions", "demo-plugin");

40+

mkdirSync(packageDir, { recursive: true });

41+

writeJsonFile(join(repoDir, "package.json"), { name: "openclaw-test-root", type: "module" });

42+

writeJsonFile(join(packageDir, "package.json"), {

43+

name: "@openclaw/demo-plugin",

44+

version: "2026.4.10",

45+

type: "module",

46+

repository: {

47+

type: "git",

48+

url: OPENCLAW_PLUGIN_NPM_REPOSITORY_URL,

49+

},

50+

openclaw: {

51+

extensions: ["./index.ts"],

52+

compat: {

53+

pluginApi: ">=2026.4.10",

54+

},

55+

build: {

56+

openclawVersion: "2026.4.10",

57+

},

58+

install: {

59+

npmSpec: "@openclaw/demo-plugin",

60+

},

61+

release: {

62+

publishToClawHub: true,

63+

publishToNpm: true,

64+

},

65+

},

66+

});

67+

writeFileSync(join(packageDir, "README.md"), "# Demo plugin\n");

68+

writeFileSync(join(packageDir, "index.ts"), "export const demo = 1;\n");

69+70+

return repoDir;

71+

}

72+73+

function callOptions(index: number): ExecOptions {

74+

return execFileSyncMock.mock.calls[index]?.[2] as ExecOptions;

75+

}

76+77+

describe("scripts/plugin-release-pretag-pack-check.ts", () => {

78+

it("collects dual-published plugin targets for npm and ClawHub pack checks", () => {

79+

const repoDir = createDualPublishPluginRepo();

80+81+

expect(collectPluginReleasePretagPackTargets(repoDir)).toEqual([

82+

{

83+

packageDir: "extensions/demo-plugin",

84+

packageName: "@openclaw/demo-plugin",

85+

packClawHub: true,

86+

packNpm: true,

87+

},

88+

]);

89+

});

90+91+

it("runs runtime build, npm pack, and ClawHub pack commands for selected targets", () => {

92+

const repoDir = createDualPublishPluginRepo();

93+

execFileSyncMock.mockImplementation(() => "");

94+95+

runPluginReleasePretagPackCheck(repoDir);

96+97+

expect(execFileSyncMock).toHaveBeenCalledTimes(3);

98+

expect(execFileSyncMock.mock.calls[0]?.slice(0, 2)).toEqual([

99+

process.execPath,

100+

[

101+

"scripts/check-plugin-npm-runtime-builds.mjs",

102+

"--package",

103+

"extensions/demo-plugin",

104+

],

105+

]);

106+

expect(callOptions(0)).toMatchObject({ cwd: repoDir, stdio: "inherit" });

107+108+

expect(execFileSyncMock.mock.calls[1]?.slice(0, 2)).toEqual([

109+

"bash",

110+

["scripts/plugin-npm-publish.sh", "--pack-dry-run", "extensions/demo-plugin"],

111+

]);

112+

expect(callOptions(1)).toMatchObject({

113+

cwd: repoDir,

114+

env: { OPENCLAW_PLUGIN_NPM_RUNTIME_BUILD: "0" },

115+

stdio: ["inherit", "ignore", "inherit"],

116+

});

117+118+

expect(execFileSyncMock.mock.calls[2]?.slice(0, 2)).toEqual([

119+

"bash",

120+

["scripts/plugin-clawhub-publish.sh", "--pack", "extensions/demo-plugin"],

121+

]);

122+

expect(callOptions(2)).toMatchObject({

123+

cwd: repoDir,

124+

env: { OPENCLAW_PLUGIN_NPM_RUNTIME_BUILD: "0" },

125+

stdio: ["inherit", "ignore", "inherit"],

126+

});

127+

expect(callOptions(2).env?.OPENCLAW_CLAWHUB_PACK_OUTPUT_DIR).toContain("clawhub-0");

128+

});

129+

});