Skip to content

Commit 896eee6

Browse files
committed
chore(cli): drop scene from the package
1 parent 1533e20 commit 896eee6

2 files changed

Lines changed: 37 additions & 50 deletions

File tree

docs/agents/branch-merge-review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ git diff --name-only <base>...<head>
5858
- [README.md](README.md) + [README_CN.md](README_CN.md)(中英文都要,常漏 `_CN`)
5959
- (SKILL.md 已迁出本仓库,由 `npx add skills` 机制独立维护,不在本仓库 review 范围)
6060
- [ ] **`bl <cmd> --help`** 文案完整:`description` / `examples` / `apiDocs` 都填了
61-
- [ ] **demo / quickstart**:用户可调用的新命令至少有一个示例(参考 [packages/cli/scene/](packages/cli/scene/) 的组织方式)
61+
- [ ] **demo / quickstart**:用户可调用的新命令至少有一个示例
6262
- [ ] **行为变化的老命令**:在 commit message / CHANGELOG 注明用户感知的差异
6363
- [ ] **错误信息 / 提示文案**:面向用户的字符串通顺、双语(项目主体是中文场景)
6464

packages/cli/tests/e2e/pipeline.e2e.test.ts

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,41 @@ import { afterAll, beforeAll, describe, expect, test } from "vite-plus/test";
22
import { mkdtemp, rm, writeFile } from "node:fs/promises";
33
import { tmpdir } from "node:os";
44
import { join } from "node:path";
5-
import { cliPackageRoot, parseStdoutJson, runCli } from "./helpers.ts";
6-
7-
const DEMO_WORKFLOWS = [
8-
"chat-basic.json",
9-
"chained-text.json",
10-
"chained-text.yaml",
11-
"image-generate.json",
12-
"image-gen/image-gen-workflow.json",
13-
"image-to-video.json",
14-
"image2video/lego/lego-build-sequence.json",
15-
"image2video/nine-grid-storyboard.json",
16-
"image2video/virtual-tryon/virtual-tryon-workflow.json",
17-
"logic-nodes.json",
18-
"commerce/amazon-listing/amazon-listing-workflow.json",
19-
"commerce/audio-meeting-summary/workflow.json",
20-
"commerce/cool-background/cool-background-workflow.json",
21-
"commerce/dress-on-model/dress-on-model-workflow.json",
22-
"commerce/flatlay/flatlay-workflow.json",
23-
"commerce/poster-i18n/poster-i18n-workflow.json",
24-
"commerce/scatter-flatlay/scatter-flatlay-workflow.json",
25-
"commerce/six-view-product/six-view-workflow.json",
26-
"commerce/valentine-marketing/valentine-marketing-workflow.json",
27-
];
5+
import { parseStdoutJson, runCli } from "./helpers.ts";
286

297
describe("e2e: pipeline", () => {
308
let tempDir: string;
9+
let chatBasicPath: string;
3110
let invalidPipelinePath: string;
3211

33-
const sceneRoot = join(cliPackageRoot, "scene");
34-
const scenePipelinePath = join(sceneRoot, "chat-basic.json");
35-
3612
beforeAll(async () => {
3713
tempDir = await mkdtemp(join(tmpdir(), "bailian-cli-pipeline-"));
14+
chatBasicPath = join(tempDir, "chat-basic.json");
15+
await writeFile(
16+
chatBasicPath,
17+
JSON.stringify({
18+
version: "workflow/v1",
19+
inputs: {
20+
type: "object",
21+
properties: {
22+
message: { type: "string", default: "Hello from the demo pipeline." },
23+
},
24+
additionalProperties: false,
25+
},
26+
steps: [
27+
{
28+
id: "chat",
29+
type: "text/chat",
30+
input: {
31+
message: { $input: "/message" },
32+
system: "You are a concise assistant for pipeline demos.",
33+
temperature: 0.2,
34+
},
35+
},
36+
],
37+
}),
38+
);
39+
3840
invalidPipelinePath = join(tempDir, "invalid-dependency-pipeline.json");
3941
await writeFile(
4042
invalidPipelinePath,
@@ -83,11 +85,11 @@ describe("e2e: pipeline", () => {
8385
expect(stderr).toMatch(/pipeline validate|workflow\.json|output json/i);
8486
});
8587

86-
test("pipeline validate --output json 校验 scene workflow", async () => {
88+
test("pipeline validate --output json 校验合法 workflow", async () => {
8789
const { stdout, stderr, exitCode } = await runCli([
8890
"pipeline",
8991
"validate",
90-
scenePipelinePath,
92+
chatBasicPath,
9193
"--output",
9294
"json",
9395
]);
@@ -98,28 +100,13 @@ describe("e2e: pipeline", () => {
98100
});
99101

100102
test("pipeline validate 使用 config 输出格式", async () => {
101-
const { stdout, stderr, exitCode } = await runCli(["pipeline", "validate", scenePipelinePath], {
103+
const { stdout, stderr, exitCode } = await runCli(["pipeline", "validate", chatBasicPath], {
102104
DASHSCOPE_OUTPUT: "text",
103105
});
104106
expect(exitCode, stderr).toBe(0);
105107
expect(stdout).toBe("Pipeline definition is valid.\n");
106108
});
107109

108-
test("pipeline validate --output json 校验迁移后的全部 scene workflows", async () => {
109-
for (const workflow of DEMO_WORKFLOWS) {
110-
const { stdout, stderr, exitCode } = await runCli([
111-
"pipeline",
112-
"validate",
113-
join(sceneRoot, workflow),
114-
"--output",
115-
"json",
116-
]);
117-
expect(exitCode, `${workflow}\n${stderr}`).toBe(0);
118-
const data = parseStdoutJson<{ valid?: boolean; issues?: string[] }>(stdout);
119-
expect(data, workflow).toEqual({ valid: true, issues: [] });
120-
}
121-
});
122-
123110
test("pipeline validate 拒绝非法依赖 workflow", async () => {
124111
const { stdout, stderr, exitCode } = await runCli([
125112
"pipeline",
@@ -145,7 +132,7 @@ describe("e2e: pipeline", () => {
145132
const { stdout, stderr, exitCode } = await runCli([
146133
"pipeline",
147134
"run",
148-
scenePipelinePath,
135+
chatBasicPath,
149136
"--input",
150137
'{"message":"hello"}',
151138
"--dry-run",
@@ -179,7 +166,7 @@ describe("e2e: pipeline", () => {
179166
[
180167
"pipeline",
181168
"run",
182-
scenePipelinePath,
169+
chatBasicPath,
183170
"--input",
184171
'{"message":"hello"}',
185172
"--dry-run",
@@ -196,7 +183,7 @@ describe("e2e: pipeline", () => {
196183
const { stderr, exitCode } = await runCli([
197184
"pipeline",
198185
"run",
199-
scenePipelinePath,
186+
chatBasicPath,
200187
"--input",
201188
'{"message":"hello"}',
202189
"--dry-run",
@@ -212,7 +199,7 @@ describe("e2e: pipeline", () => {
212199
const { stdout, stderr, exitCode } = await runCli([
213200
"pipeline",
214201
"run",
215-
scenePipelinePath,
202+
chatBasicPath,
216203
"--input",
217204
'{"message":"hello"}',
218205
"--dry-run",
@@ -240,7 +227,7 @@ describe("e2e: pipeline", () => {
240227
const { stdout, stderr, exitCode } = await runCli([
241228
"pipeline",
242229
"run",
243-
scenePipelinePath,
230+
chatBasicPath,
244231
"--dry-run",
245232
"--events",
246233
"bogus",

0 commit comments

Comments
 (0)