chore: gate launch on PNVS diagnostics

This commit is contained in:
Codex
2026-07-04 00:06:30 +08:00
parent 287c2476c6
commit 1f897c8451
4 changed files with 68 additions and 1 deletions

View File

@@ -130,6 +130,30 @@ assert.ok(
'missing PNVS SMS smoke should be reported as a blocker',
);
const missingSmsPnvsDiagnostics = runGate(tempDir => {
const evidence = createEvidence(tempDir);
evidence.checks = evidence.checks.filter(item => item.id !== 'auth.sms-pnvs-diagnostics');
return evidence;
});
assert.notEqual(missingSmsPnvsDiagnostics.status, 0, 'missing PNVS diagnostics should fail launch gate');
assert.ok(
missingSmsPnvsDiagnostics.payload.checks?.some(item => item.id === 'check.auth.sms-pnvs-diagnostics' && item.status === 'blocker'),
'missing PNVS diagnostics should be reported as a blocker',
);
const wrongSmsPnvsDiagnostics = runGate(tempDir => {
const evidence = createEvidence(tempDir);
const item = evidence.checks.find(check => check.id === 'auth.sms-pnvs-diagnostics');
item.summary.env.providerMatchesPnvs = false;
item.summary.provider.provider = 'aliyun';
return evidence;
});
assert.notEqual(wrongSmsPnvsDiagnostics.status, 0, 'non-PNVS diagnostics should fail launch gate');
assert.ok(
wrongSmsPnvsDiagnostics.payload.checks?.some(item => item.id === 'check.auth.sms-pnvs-diagnostics.summary' && item.status === 'blocker'),
'non-PNVS diagnostics should be reported as a blocker',
);
const wrongSmsProviderSmoke = runGate(tempDir => {
const evidence = createEvidence(tempDir);
const item = evidence.checks.find(check => check.id === 'auth.sms-pnvs-remote-smoke');

View File

@@ -38,6 +38,22 @@ const gateChecks = [
commandIncludes: 'smoke:auth:remote',
summary: { failed: 0, requireAdminTokens: true },
},
{
id: 'auth.sms-pnvs-diagnostics',
label: 'Aliyun PNVS SMS provider diagnostics',
commandIncludes: 'diagnose:aliyun-pnvs',
summary: {
ok: true,
'env.providerMatchesPnvs': true,
'provider.found': true,
'provider.provider': 'aliyun-pnvs',
'provider.status': { oneOf: ['active', 'testing'] },
'provider.publicConfig.templateParamHasCodePlaceholder': true,
'secret.found': true,
'secret.accessKeyIdLength': { gt: 0 },
'secret.accessKeySecretLength': { gt: 0 },
},
},
{
id: 'auth.sms-pnvs-remote-smoke',
label: 'Remote Aliyun PNVS SMS login smoke',