From e2efcfda7739e826fa125fc23e966329c5dca1c4 Mon Sep 17 00:00:00 2001 From: "zeyu.fz" Date: Thu, 2 Jul 2026 15:58:14 +0800 Subject: [PATCH] =?UTF-8?q?test(cli):=20=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0E2E=E6=B5=8B=E8=AF=95=E7=9A=84?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E8=B0=83=E8=AF=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入 isBailianE2EEnabled 方法用于调试 - 在 worker 进程中打印关键环境变量 DASHSCOPE_API_KEY - 打印 isDashScopeE2EReady 与 isBailianE2EEnabled 的返回结果 - 方便排查文件上传相关E2E测试环境状态问题 --- packages/cli/tests/e2e/file-upload.e2e.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/cli/tests/e2e/file-upload.e2e.test.ts b/packages/cli/tests/e2e/file-upload.e2e.test.ts index da6c611..7d5daf3 100644 --- a/packages/cli/tests/e2e/file-upload.e2e.test.ts +++ b/packages/cli/tests/e2e/file-upload.e2e.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vite-plus/test"; import { dirname, join } from "path"; import { fileURLToPath } from "url"; -import { isDashScopeE2EReady, parseStdoutJson, runCli } from "./helpers.ts"; +import { isBailianE2EEnabled, isDashScopeE2EReady, parseStdoutJson, runCli } from "./helpers.ts"; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -24,6 +24,15 @@ describe("e2e: file upload", () => { }); }); +// === DEBUG: worker 进程中的环境变量 === +console.log( + "[worker:file-upload] DASHSCOPE_API_KEY =", + JSON.stringify(process.env.DASHSCOPE_API_KEY), +); +console.log("[worker:file-upload] isDashScopeE2EReady() =", isDashScopeE2EReady()); +console.log("[worker:file-upload] isBailianE2EEnabled() =", isBailianE2EEnabled()); +// === DEBUG END === + describe.skipIf(!isDashScopeE2EReady())("e2e: file upload(DashScope)", () => { test("file upload 缺少 --file 时打印子命令帮助并退出 (0)", async () => { const { stderr, exitCode } = await runCli([