优化
This commit is contained in:
@@ -72,12 +72,24 @@ test('production deploy uses DEPLOY as the single explicit release switch', () =
|
||||
})
|
||||
|
||||
test('production deploy reports one aggregated result to WeCom', () => {
|
||||
const sourceCommitIndex = pipeline.indexOf("env.SOURCE_COMMIT = sh(script: 'git rev-parse HEAD'")
|
||||
const productionGuardIndex = pipeline.indexOf("if (env.RESOLVED_ENVIRONMENT == 'production')")
|
||||
|
||||
assert.match(pipeline, /credentialsId: 'wecom-prod-webhook'/)
|
||||
assert.match(pipeline, /node\('java-builder'\) \{[\s\S]*?WECOM_WEBHOOK/)
|
||||
assert.match(pipeline, /env\.JOB_BASE_NAME == 'backend-java-prod' && params\.DEPLOY/)
|
||||
assert.match(pipeline, /unstable \{[\s\S]*?'\u90e8\u7f72\u90e8\u5206\u5931\u8d25'/)
|
||||
assert.match(pipeline, /failure \{[\s\S]*?'\u90e8\u7f72\u5931\u8d25'/)
|
||||
assert.match(pipeline, /aborted \{[\s\S]*?'\u90e8\u7f72\u5df2\u53d6\u6d88'/)
|
||||
assert.ok(sourceCommitIndex >= 0, 'source commit must be recorded for notifications')
|
||||
assert.ok(sourceCommitIndex < productionGuardIndex,
|
||||
'source commit must be recorded before production validation can fail')
|
||||
assert.match(pipeline, /def downstreamBuildUrls = \[:\]/)
|
||||
assert.match(pipeline, /downstreamBuildUrls\[service\] = downstreamBuild\.absoluteUrl/)
|
||||
assert.match(pipeline, /downstreamBuildNumbers\[service\] = downstreamBuild\.number/)
|
||||
assert.match(pipeline, /unstable \{[\s\S]*?'\u26a0\ufe0f \u751f\u4ea7\u90e8\u7f72\u90e8\u5206\u5931\u8d25'/)
|
||||
assert.match(pipeline, /\u7ed3\u679c\uff1a\u6210\u529f \$\{successCount\} \/ \u5931\u8d25 \$\{failedServices\.size\(\)\}/)
|
||||
assert.match(pipeline, /\u5931\u8d25\u670d\u52a1\uff1a\$\{failedLinks/)
|
||||
assert.match(pipeline, /failure \{[\s\S]*?'\u274c \u751f\u4ea7\u53d1\u5e03\u5931\u8d25'/)
|
||||
assert.match(pipeline, /aborted \{[\s\S]*?'\u23f9 \u751f\u4ea7\u90e8\u7f72\u5df2\u53d6\u6d88'/)
|
||||
assert.match(pipeline, /> \u8017\u65f6\uff1a\$\{duration\}/)
|
||||
assert.match(pipeline, /\u4f01\u4e1a\u5fae\u4fe1\u901a\u77e5\u5931\u8d25\uff0c\u4e0d\u5f71\u54cd\u539f\u6784\u5efa\u7ed3\u679c/)
|
||||
assert.doesNotMatch(servicePipeline, /wecom-prod-webhook|sendProductionWeComNotification/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user