forked from wangziqi/gongxue-base
test: add taro h5 interaction smoke
This commit is contained in:
@@ -24,7 +24,17 @@ function sampleSummaryValue(expectedValue) {
|
||||
}
|
||||
|
||||
function sampleSummary(summarySpec) {
|
||||
return Object.fromEntries(Object.entries(summarySpec || {}).map(([key, value]) => [key, sampleSummaryValue(value)]));
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(summarySpec || {})) {
|
||||
const parts = key.split('.');
|
||||
let cursor = result;
|
||||
for (const part of parts.slice(0, -1)) {
|
||||
if (!cursor[part] || typeof cursor[part] !== 'object') cursor[part] = {};
|
||||
cursor = cursor[part];
|
||||
}
|
||||
cursor[parts.at(-1)] = sampleSummaryValue(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function createEvidence(tempDir, overrides = {}) {
|
||||
@@ -154,6 +164,17 @@ assert.ok(
|
||||
'missing H5 static smoke should be reported as a blocker',
|
||||
);
|
||||
|
||||
const missingTaroInteractionSmoke = runGate(tempDir => {
|
||||
const evidence = createEvidence(tempDir);
|
||||
evidence.checks = evidence.checks.filter(item => item.id !== 'taro.h5-interaction-smoke');
|
||||
return evidence;
|
||||
});
|
||||
assert.notEqual(missingTaroInteractionSmoke.status, 0, 'missing H5 interaction smoke should fail launch gate');
|
||||
assert.ok(
|
||||
missingTaroInteractionSmoke.payload.checks?.some(item => item.id === 'check.taro.h5-interaction-smoke' && item.status === 'blocker'),
|
||||
'missing H5 interaction smoke should be reported as a blocker',
|
||||
);
|
||||
|
||||
const missingAttestation = runGate(tempDir => {
|
||||
const evidence = createEvidence(tempDir);
|
||||
evidence.attestations = evidence.attestations.filter(item => item.id !== 'backup.snapshot');
|
||||
|
||||
Reference in New Issue
Block a user