test(cli): 添加文件上传E2E测试的环境变量调试信息

- 引入 isBailianE2EEnabled 方法用于调试
- 在 worker 进程中打印关键环境变量 DASHSCOPE_API_KEY
- 打印 isDashScopeE2EReady 与 isBailianE2EEnabled 的返回结果
- 方便排查文件上传相关E2E测试环境状态问题
This commit is contained in:
zeyu.fz
2026-07-02 15:58:14 +08:00
parent a078670445
commit e2efcfda77
+10 -1
View File
@@ -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([