mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 22:03:15 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
112
openclaw/test/scripts/ios-pin-version.test.ts
Normal file
112
openclaw/test/scripts/ios-pin-version.test.ts
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { pinIosVersion, parseArgs } from "../../scripts/ios-pin-version.ts";
|
||||
import { resolveIosVersion } from "../../scripts/lib/ios-version.ts";
|
||||
import { installIosFixtureCleanup, writeIosFixture } from "./ios-version.test-support.ts";
|
||||
|
||||
installIosFixtureCleanup();
|
||||
|
||||
describe("parseArgs", () => {
|
||||
it("requires exactly one pin source", () => {
|
||||
expect(() => parseArgs([])).toThrow(
|
||||
"Choose exactly one of --from-gateway or --version <YYYY.M.D>",
|
||||
);
|
||||
expect(() => parseArgs(["--from-gateway", "--version", "2026.4.7"])).toThrow(
|
||||
"Choose exactly one of --from-gateway or --version <YYYY.M.D>",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("pinIosVersion", () => {
|
||||
it("pins an explicit iOS release version and syncs generated artifacts", () => {
|
||||
const rootDir = writeIosFixture({
|
||||
version: "2026.4.6",
|
||||
changelog: `# OpenClaw iOS Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Draft release notes.
|
||||
`,
|
||||
prefix: "openclaw-ios-pin-",
|
||||
});
|
||||
|
||||
const result = pinIosVersion({
|
||||
explicitVersion: "2026.4.7",
|
||||
fromGateway: false,
|
||||
rootDir,
|
||||
sync: true,
|
||||
});
|
||||
|
||||
expect(result.previousVersion).toBe("2026.4.6");
|
||||
expect(result.nextVersion).toBe("2026.4.7");
|
||||
expect(result.packageVersion).toBeNull();
|
||||
expect(resolveIosVersion(rootDir).canonicalVersion).toBe("2026.4.7");
|
||||
expect(fs.readFileSync(path.join(rootDir, "apps", "ios", "version.json"), "utf8")).toContain(
|
||||
'"version": "2026.4.7"',
|
||||
);
|
||||
expect(
|
||||
fs.readFileSync(path.join(rootDir, "apps", "ios", "Config", "Version.xcconfig"), "utf8"),
|
||||
).toContain("OPENCLAW_MARKETING_VERSION = 2026.4.7");
|
||||
expect(
|
||||
fs.readFileSync(
|
||||
path.join(rootDir, "apps", "ios", "fastlane", "metadata", "en-US", "release_notes.txt"),
|
||||
"utf8",
|
||||
),
|
||||
).toContain("- Draft release notes.");
|
||||
expect(result.syncedPaths).toHaveLength(2);
|
||||
});
|
||||
|
||||
it("pins from the current gateway version without carrying prerelease suffixes", () => {
|
||||
const rootDir = writeIosFixture({
|
||||
version: "2026.4.6",
|
||||
packageVersion: "2026.4.10-beta.3",
|
||||
changelog: `# OpenClaw iOS Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Candidate release notes.
|
||||
`,
|
||||
prefix: "openclaw-ios-pin-",
|
||||
});
|
||||
|
||||
const result = pinIosVersion({
|
||||
explicitVersion: null,
|
||||
fromGateway: true,
|
||||
rootDir,
|
||||
sync: true,
|
||||
});
|
||||
|
||||
expect(result.previousVersion).toBe("2026.4.6");
|
||||
expect(result.nextVersion).toBe("2026.4.10");
|
||||
expect(result.packageVersion).toBe("2026.4.10-beta.3");
|
||||
expect(resolveIosVersion(rootDir).marketingVersion).toBe("2026.4.10");
|
||||
});
|
||||
|
||||
it("can skip syncing checked-in artifacts when requested", () => {
|
||||
const rootDir = writeIosFixture({
|
||||
version: "2026.4.6",
|
||||
changelog: `# OpenClaw iOS Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Candidate release notes.
|
||||
`,
|
||||
versionXcconfig: "stale\n",
|
||||
releaseNotes: "stale\n",
|
||||
prefix: "openclaw-ios-pin-",
|
||||
});
|
||||
|
||||
const result = pinIosVersion({
|
||||
explicitVersion: "2026.4.8",
|
||||
fromGateway: false,
|
||||
rootDir,
|
||||
sync: false,
|
||||
});
|
||||
|
||||
expect(result.syncedPaths).toHaveLength(0);
|
||||
expect(
|
||||
fs.readFileSync(path.join(rootDir, "apps", "ios", "Config", "Version.xcconfig"), "utf8"),
|
||||
).toBe("stale\n");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue