mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
8ee2c378f5
- 新增多模态问答及检索服务的 live E2E 测试用例,支持基于图像参数的功能验证 - 补充表格库的 chunk add/list/delete 闭环测试,验证了 field channel 的必填项和读写一致性 - 增加图片库 chunk list 的 metadata 验证,确保 image_url 数组和可见性标志存在 - 实现带覆盖重导功能的 doc import-oss 测试,确认覆盖后 fileId 变更及旧文件失效 - 编写自有 OSS Bucket 的幂等复用集合创建和获取测试,确保服务端的 tag-based 访问控制支持 - 在 gating 中添加对各类长驻知识库及服务环境变量的就绪检测函数
75 lines
1.8 KiB
TypeScript
75 lines
1.8 KiB
TypeScript
import { dirname, join } from "path";
|
|
import { fileURLToPath } from "url";
|
|
import {
|
|
cliTimeoutPrefix,
|
|
cliTimeoutSeconds,
|
|
e2eLabelFromMetaUrl,
|
|
isConsoleAuthFailure,
|
|
makeE2eOutputDir,
|
|
parseStdoutJson,
|
|
} from "e2e/output";
|
|
import { runNodeMain, type RunCliResult } from "e2e/runner";
|
|
import type { E2eRouteExports } from "./topic-routes.ts";
|
|
|
|
export {
|
|
cliTimeoutPrefix,
|
|
cliTimeoutSeconds,
|
|
e2eLabelFromMetaUrl,
|
|
isConsoleAuthFailure,
|
|
makeE2eOutputDir,
|
|
parseStdoutJson,
|
|
};
|
|
export type { RunCliResult };
|
|
|
|
export {
|
|
isBailianE2EEnabled,
|
|
isBailianE2EMediaEnabled,
|
|
isBailianE2EVideoEnabled,
|
|
isChatE2EReady,
|
|
isConnectorE2EReady,
|
|
isConsoleE2EReady,
|
|
isDashScopeE2EReady,
|
|
isImageKbE2EReady,
|
|
isKbAdminE2EReady,
|
|
isMultimodalChatE2EReady,
|
|
isMultimodalSearchE2EReady,
|
|
isOpenApiE2EReady,
|
|
isOssImportE2EReady,
|
|
isSearchE2EReady,
|
|
isTableKbE2EReady,
|
|
isTableSearchE2EReady,
|
|
} from "e2e/gating";
|
|
|
|
const e2eDir = dirname(fileURLToPath(import.meta.url));
|
|
const harnessMainTs = join(e2eDir, "harness", "main.ts");
|
|
|
|
/** `packages/commands` 根目录 */
|
|
export const commandsPackageRoot = join(e2eDir, "..", "..");
|
|
|
|
/** E2E fixtures 目录 */
|
|
export const e2eFixturesDir = join(e2eDir, "fixtures");
|
|
|
|
function serializeRoutes(routes: E2eRouteExports): string {
|
|
return JSON.stringify(
|
|
Object.entries(routes).map(([path, exportName]) => ({ path, export: exportName })),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 通过 harness 子进程执行命令 E2E。
|
|
* `routes` 为本用例所需的最小 path → export 映射,不维护全量产品 map。
|
|
*/
|
|
export async function runCommandE2e(
|
|
routes: E2eRouteExports,
|
|
args: string[],
|
|
envOverrides: NodeJS.ProcessEnv = {},
|
|
): Promise<RunCliResult> {
|
|
return runNodeMain(harnessMainTs, args, {
|
|
cwd: commandsPackageRoot,
|
|
env: {
|
|
BAILIAN_E2E_ROUTES: serializeRoutes(routes),
|
|
...envOverrides,
|
|
},
|
|
});
|
|
}
|