From 1c94e6f9668777d14a6941a1c4fc66494a585519 Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 1 Jul 2026 08:17:41 +0800 Subject: [PATCH] test: require full h5 interaction evidence --- .../production-launch-evidence.template.json | 10 ++++++-- scripts/production-launch-gate-test.js | 24 +++++++++++++++++++ scripts/production-launch-gate.js | 8 ++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/refactor/production-launch-evidence.template.json b/docs/refactor/production-launch-evidence.template.json index 6c366867..908a5d41 100644 --- a/docs/refactor/production-launch-evidence.template.json +++ b/docs/refactor/production-launch-evidence.template.json @@ -263,14 +263,20 @@ "artifact": "launch-artifacts/taro-h5-interaction-smoke.json", "summary": { "fail": 0, - "pass": 26, + "pass": 32, "mockApi": { "keyRequests": { "answers": 1, "favorites": 2, "ordersCreated": 1, "paymentsCreated": 1, - "orderStatus": 1 + "orderStatus": 1, + "tenantResolve": 3, + "tenantContentWrites": 1, + "tenantAdminWrites": 1, + "crmWrites": 1, + "commissionWrites": 1, + "platformAdminWrites": 1 } } } diff --git a/scripts/production-launch-gate-test.js b/scripts/production-launch-gate-test.js index 16fe4350..1ac03fab 100644 --- a/scripts/production-launch-gate-test.js +++ b/scripts/production-launch-gate-test.js @@ -209,6 +209,30 @@ assert.ok( 'missing H5 interaction smoke should be reported as a blocker', ); +const oldTaroInteractionCoverage = runGate(tempDir => { + const evidence = createEvidence(tempDir); + const item = evidence.checks.find(check => check.id === 'taro.h5-interaction-smoke'); + item.summary.pass = 26; + return evidence; +}); +assert.notEqual(oldTaroInteractionCoverage.status, 0, 'old 26-check H5 interaction evidence should fail launch gate'); +assert.ok( + oldTaroInteractionCoverage.payload.checks?.some(item => item.id === 'check.taro.h5-interaction-smoke.summary' && item.status === 'blocker'), + 'old H5 interaction coverage should be reported as a blocker', +); + +const missingAdminWriteCoverage = runGate(tempDir => { + const evidence = createEvidence(tempDir); + const item = evidence.checks.find(check => check.id === 'taro.h5-interaction-smoke'); + item.summary.mockApi.keyRequests.platformAdminWrites = 0; + return evidence; +}); +assert.notEqual(missingAdminWriteCoverage.status, 0, 'H5 interaction evidence without platform admin writes should fail launch gate'); +assert.ok( + missingAdminWriteCoverage.payload.checks?.some(item => item.id === 'check.taro.h5-interaction-smoke.summary' && item.status === 'blocker'), + 'missing platform admin write coverage should be reported as a blocker', +); + const missingTaroReleaseManifest = runGate(tempDir => { const evidence = createEvidence(tempDir); evidence.checks = evidence.checks.filter(item => item.id !== 'taro.h5-release-manifest'); diff --git a/scripts/production-launch-gate.js b/scripts/production-launch-gate.js index 9aed7774..72561c9e 100644 --- a/scripts/production-launch-gate.js +++ b/scripts/production-launch-gate.js @@ -166,12 +166,18 @@ const gateChecks = [ commandIncludes: 'smoke:taro:h5:interaction', summary: { fail: 0, - pass: { gte: 26 }, + pass: { gte: 32 }, 'mockApi.keyRequests.answers': { gte: 1 }, 'mockApi.keyRequests.favorites': { gte: 1 }, 'mockApi.keyRequests.ordersCreated': { gte: 1 }, 'mockApi.keyRequests.paymentsCreated': { gte: 1 }, 'mockApi.keyRequests.orderStatus': { gte: 1 }, + 'mockApi.keyRequests.tenantResolve': { gte: 3 }, + 'mockApi.keyRequests.tenantContentWrites': { gte: 1 }, + 'mockApi.keyRequests.tenantAdminWrites': { gte: 1 }, + 'mockApi.keyRequests.crmWrites': { gte: 1 }, + 'mockApi.keyRequests.commissionWrites': { gte: 1 }, + 'mockApi.keyRequests.platformAdminWrites': { gte: 1 }, }, }, {