/** * pipeline-test — Pipeline 专用测试引擎 * * 在 build 之后、deploy 之前执行,测试失败可阻断部署。 * * 支持三种测试层级: * 1. build-check: 构建产物检查(默认,轻量级) * 2. smoke: HTTP 可达性检查(需要 base_url) * 3. visual: 视觉回归测试(需要 Playwright + 视觉模型) * 4. api: API 契约测试 * 5. all: 依次执行 build-check + smoke + visual + api * * v8.3.60+ */ import type { EnvironmentConfig } from './environment-config'; import type { PlatformConfig } from './unified-config'; import type { SmokeResult, VisualResult } from './ui-verify'; import type { ApiVerifyReport } from './api-verify'; export interface PipelineTestOptions { /** 测试平台 */ platform: PlatformConfig; /** 环境名 */ env: string; /** 测试类型 */ type: 'build-check' | 'smoke' | 'visual' | 'api' | 'all'; /** 环境配置(用于读取 tests.base_urls / local_urls 等) */ envConfig?: EnvironmentConfig; /** 是否预览模式 */ dryRun?: boolean; /** 构建输出目录(用于 build-check) */ outputDir?: string; /** 超时时间(毫秒) */ timeout?: number; /** 测试阶段(v8.3.98+):pre-deploy 用 local_urls,post-deploy 用 base_urls */ stage?: 'pre-deploy' | 'post-deploy'; } export interface PipelineTestResult { /** 平台名 */ platform: string; /** 是否全部通过 */ passed: boolean; /** 失败严重程度: critical(严重,必须阻断) / warning(警告,可继续部署) */ severity: 'critical' | 'warning'; /** 执行的测试类型列表 */ types: string[]; /** 耗时(毫秒) */ duration: number; /** 各测试详情 */ details: { buildCheck?: BuildCheckResult; smoke?: SmokeResult[]; visual?: VisualResult[]; api?: ApiVerifyReport; }; /** 汇总 */ summary: { total: number; passed: number; failed: number; }; /** 错误信息(整体失败时) */ error?: string; } interface BuildCheckResult { passed: boolean; checks: Array<{ name: string; passed: boolean; message?: string; }>; } /** * 执行 Pipeline 测试 * * 按配置的类型依次执行测试,任一失败即返回失败结果。 */ export declare function runPipelineTest(options: PipelineTestOptions): Promise; /** * 生成 Pipeline 测试报告(供 Skill / AI 读取) * * 输出格式便于 AI 解析失败原因。 */ export declare function formatPipelineTestReport(result: PipelineTestResult): string; export {}; //# sourceMappingURL=pipeline-test.d.ts.map