






















@@ -5,28 +5,34 @@ import path from "node:path";
55import { bundledPluginFile } from "openclaw/plugin-sdk/test-fixtures";
66import { afterEach, describe, expect, it } from "vitest";
778-const { detectChangedScope, detectInstallSmokeScope, detectNodeFastScope, listChangedPaths } =
9-(await import("../../scripts/ci-changed-scope.mjs")) as unknown as {
10-detectChangedScope: (paths: string[]) => {
11-runNode: boolean;
12-runMacos: boolean;
13-runAndroid: boolean;
14-runWindows: boolean;
15-runSkillsPython: boolean;
16-runChangedSmoke: boolean;
17-runControlUiI18n: boolean;
18-};
19-detectInstallSmokeScope: (paths: string[]) => {
20-runFastInstallSmoke: boolean;
21-runFullInstallSmoke: boolean;
22-};
23-detectNodeFastScope: (paths: string[]) => {
24-runFastOnly: boolean;
25-runPluginContracts: boolean;
26-runCiRouting: boolean;
27-};
28-listChangedPaths: (base: string, head?: string) => string[];
8+const {
9+ detectChangedScope,
10+ detectInstallSmokeScope,
11+ detectNodeFastScope,
12+ detectPromptSnapshotScope,
13+ listChangedPaths,
14+} = (await import("../../scripts/ci-changed-scope.mjs")) as unknown as {
15+detectChangedScope: (paths: string[]) => {
16+runNode: boolean;
17+runMacos: boolean;
18+runAndroid: boolean;
19+runWindows: boolean;
20+runSkillsPython: boolean;
21+runChangedSmoke: boolean;
22+runControlUiI18n: boolean;
2923};
24+detectInstallSmokeScope: (paths: string[]) => {
25+runFastInstallSmoke: boolean;
26+runFullInstallSmoke: boolean;
27+};
28+detectNodeFastScope: (paths: string[]) => {
29+runFastOnly: boolean;
30+runPluginContracts: boolean;
31+runCiRouting: boolean;
32+};
33+detectPromptSnapshotScope: (paths: string[]) => boolean;
34+listChangedPaths: (base: string, head?: string) => string[];
35+};
30363137const markerPaths: string[] = [];
3238const tempDirs: string[] = [];
@@ -614,6 +620,23 @@ describe("detectChangedScope", () => {
614620run_fast_install_smoke: "false",
615621run_full_install_smoke: "false",
616622run_control_ui_i18n: "false",
623+run_prompt_snapshots: "false",
617624});
618625});
626+627+it("runs prompt snapshots only for prompt-affecting paths", () => {
628+expect(detectPromptSnapshotScope([])).toBe(true);
629+expect(
630+detectPromptSnapshotScope(["src/agents/failover-error.ts", "src/agents/model-fallback.ts"]),
631+).toBe(false);
632+expect(detectPromptSnapshotScope(["extensions/codex/src/app-server/thread-lifecycle.ts"])).toBe(
633+true,
634+);
635+expect(
636+detectPromptSnapshotScope([
637+"test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/README.md",
638+]),
639+).toBe(true);
640+expect(detectPromptSnapshotScope(["src/agents/pi-tools.schema.ts"])).toBe(true);
641+});
619642});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。