perf(ci): run selected tests once before service builds

This commit is contained in:
2026-08-24 13:43:38 +08:00
parent 9dd2fcb7e5
commit b012d64b54
4 changed files with 58 additions and 6 deletions
@@ -30,8 +30,9 @@ test('coordinator jobs present their own deployment environment as the default c
})
test('production deployments cannot skip tests', () => {
assert.match(pipeline, /params\.ENVIRONMENT == 'production' && params\.SKIP_TESTS/)
assert.match(pipeline, /error\('生产环境禁止跳过测试'\)/)
assert.match(coordinatorPipeline, /env\.RESOLVED_ENVIRONMENT == 'production' && params\.SKIP_TESTS/)
assert.match(coordinatorPipeline, /error\('生产环境禁止跳过测试'\)/)
assert.match(pipeline, /生产环境手工构建禁止跳过测试/)
})
test('Java builds use the shared builder pool and serialize incremental target deployments', () => {
@@ -51,6 +52,12 @@ test('Java builds use the shared builder pool and serialize incremental target d
assert.match(directDeployScript, /--pull never/)
})
test('production only accepts skipped downstream tests for a coordinator-pinned commit', () => {
assert.match(pipeline, /boolean coordinatorPinnedCommit = params\.SOURCE_COMMIT\?\.trim\(\) as boolean/)
assert.match(pipeline, /params\.ENVIRONMENT == 'production' && params\.SKIP_TESTS && !coordinatorPinnedCommit/)
assert.match(pipeline, /生产环境手工构建禁止跳过测试/)
})
test('development and test deployment locks are acquired before target executors', () => {
const directDeployStage = pipeline.slice(
pipeline.indexOf("stage('部署开发或测试环境')"),