perf(ci): run selected tests once before service builds
This commit is contained in:
@@ -13,6 +13,17 @@ test('coordinator releases its builder while waiting for downstream jobs', () =>
|
||||
assert.doesNotMatch(pipeline, /cleanWs\(/)
|
||||
})
|
||||
|
||||
test('coordinator runs selected tests once before parallel service packaging', () => {
|
||||
const gateIndex = pipeline.indexOf("stage('统一 Maven 测试门禁')")
|
||||
const dispatchIndex = pipeline.indexOf("stage('并行调度独立服务 Job')")
|
||||
|
||||
assert.ok(gateIndex >= 0, 'unified test gate must exist')
|
||||
assert.ok(dispatchIndex > gateIndex, 'unified tests must finish before downstream dispatch')
|
||||
assert.match(pipeline, /-pl \$\{selectedModules\} -am test/)
|
||||
assert.match(pipeline, /booleanParam\(name: 'SKIP_TESTS', value: true\)/)
|
||||
assert.doesNotMatch(pipeline, /TESTED_COMMIT/)
|
||||
})
|
||||
|
||||
test('AUTO detects database migrations without expanding them to all services', () => {
|
||||
assert.match(pipeline, /def databaseMigrationPaths = \['deploy\/sql\/'\]/)
|
||||
assert.match(pipeline, /!databaseMigration && commonPaths\.any/)
|
||||
|
||||
@@ -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('部署开发或测试环境')"),
|
||||
|
||||
Reference in New Issue
Block a user