This commit is contained in:
2026-11-04 18:08:19 +08:00
parent 0993dd446e
commit 51291b4c27
16 changed files with 468 additions and 47 deletions
+9 -4
View File
@@ -8,10 +8,10 @@ import { describeAcceptanceScope } from './admin-test-env-acceptance.mjs'
export function describeHomepageBusinessCoverage() {
const scope = describeAcceptanceScope()
return [
{ title: '头程下单', route: '/orders/first-leg/create', modules: ['orders', 'phase5-overseas-fulfillment'],
{ title: '头程下单', route: '/orders/first-leg/create', modules: ['orders', 'phase5-overseas-fulfillment', 'mixed-container-receiving'],
additionalModules: ['phase5-root-fulfillment', 'dropship-pallet-matrix'],
covered: '默认头程至海外履约主链;拆分根单、一件代发矩阵为可选专项',
remaining: '各订单类型、税制及根/余量分支未由默认链全部执行' },
covered: '默认头程至海外履约主链,以及混柜收货、私人地址全收与短少确认;拆分根单和其他一件代发矩阵为可选专项',
remaining: '全部税制、根/余量及一件代发出库矩阵未由默认链全部执行' },
{ title: '退货换标', route: '/overseas-warehouse/return-relabel/create', modules: ['phase4-overseas-return-receipt', 'phase4-overseas-return-followups'],
covered: '退货预报、审核、签收、合箱、换标、客户确认及换标后出库',
remaining: '换标、客户确认及换标后出库已接入默认后续模块;固定客户跨客户边界仍缺资源,真实HTTP待验' },
@@ -53,16 +53,21 @@ export function summarizeReport(report) {
// 历史报告不包含计划信息,不能从断言数量或模块名字推定完整执行。
const scopeKnown = Array.isArray(scope?.plannedModules) && scope.plannedModules.length > 0
&& Array.isArray(scope.defaultModules) && scope.defaultModules.length > 0
const observedModules = new Set(steps.map((step) => step.module))
const observedModules = new Set(Array.isArray(report.modules)
? report.modules.filter(module => !module.skipped && module.success === true && Number(module.passed) > 0).map(module => module.name)
: steps.map((step) => step.module))
const missingModules = scopeKnown ? scope.plannedModules.filter((name) => !observedModules.has(name)) : []
const limited = Boolean(scope?.preparationOnly || scope?.returnMainChainOnly || report.fullAcceptance === false)
const failedResult = Boolean(report.fatal) || report.success === false || failed.length > 0 || blockers.length > 0
|| Boolean(scope?.stoppedByRequest) || (report.deploymentBlockers || []).length > 0
|| (report.modules || []).some(module => !module.skipped && (module.success === false || module.fatal))
return {
result: failedResult ? 'FAILED' : skipped.length || skippedModules || gaps.length || missingModules.length || limited ? 'INCOMPLETE' : 'RECORDED_CHECKS_PASSED',
passed: steps.filter((step) => step.passed && !step.skipped).length,
failed: failed.length,
skipped: skipped.length,
skippedModules,
readOnlyModules: (report.modules || []).filter(module => module.coverageMode === 'READ_ONLY').map(module => module.name),
blockingGaps: blockers.length,
nonBlockingGaps: gaps.length - blockers.length,
failedModules: [...new Set(failed.map((step) => step.module).filter(Boolean))],