test: deduplicate acceptance coverage gaps

This commit is contained in:
2026-09-06 11:41:46 +08:00
parent 54af43a99d
commit 42ddc19826
2 changed files with 10 additions and 1 deletions
+7 -1
View File
@@ -714,7 +714,13 @@ export class AcceptanceRun {
addCoverageGap(module, scenario, name, reason, category = 'not-implemented', metadata = {}) {
const nonBlocking = new Set(['device', 'external-third-party', 'visual'])
const blocking = metadata.blocking ?? !nonBlocking.has(category)
this.coverageGaps.push({ module, scenario, name, reason, category, blocking, ...metadata })
const gap = { module, scenario, name, reason, category, blocking, ...metadata }
const duplicate = this.coverageGaps.some((existing) => existing.module === gap.module
&& existing.scenario === gap.scenario && existing.name === gap.name
&& existing.reason === gap.reason && existing.category === gap.category
&& existing.blocking === gap.blocking)
if (duplicate) return
this.coverageGaps.push(gap)
if (blocking) {
this.addStep(module, `覆盖阻断:${name}`, null, false, reason,
{ scenario, deploymentBlocker: true })
@@ -144,7 +144,10 @@ test('core coverage gaps fail closed while device and external-provider gaps rem
const stepCount = run.steps.length
run.addCoverageGap('phase3', 'device', 'Android', 'manual device validation', 'device')
run.addCoverageGap('phase3', 'provider', 'captcha', 'external captcha', 'external-third-party')
run.addCoverageGap('phase3', 'device', 'Android', 'manual device validation', 'device')
run.addCoverageGap('phase3', 'provider', 'captcha', 'external captcha', 'external-third-party')
assert.equal(run.steps.length, stepCount)
assert.equal(run.coverageGaps.length, 3)
})
test('PDA entry expands the real phase-three producer chain and builds an FBA/OVERSEAS/second-container matrix', () => {