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
@@ -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/)