fix(ci): make AUTO deployment incremental
This commit is contained in:
@@ -37,6 +37,30 @@ test('coordinator jobs present their own deployment environment as the default c
|
||||
assert.match(coordinatorPipeline, /downstreamJobPrefixForJob\(env\.JOB_BASE_NAME\)/)
|
||||
})
|
||||
|
||||
test('AUTO keeps its own baseline and retries only previously failed services', () => {
|
||||
assert.match(coordinatorPipeline, /def parseAutoBuildState\(/)
|
||||
assert.match(coordinatorPipeline, /def previousAutoBuildState\(/)
|
||||
assert.match(coordinatorPipeline, /previousAutoBuildState\(currentBuild\.previousBuild, serviceModules\)/)
|
||||
assert.match(coordinatorPipeline, /selected\.addAll\(retryServices\)/)
|
||||
assert.match(coordinatorPipeline, /AUTO \$\{env\.IMAGE_TAG\} \| PENDING/)
|
||||
assert.match(coordinatorPipeline, /AUTO \$\{env\.IMAGE_TAG\} \| RESULTS/)
|
||||
assert.doesNotMatch(coordinatorPipeline, /commonChanged \? serviceModules/)
|
||||
})
|
||||
|
||||
test('AUTO maps shared modules to their real consumers instead of rebuilding every service', () => {
|
||||
const securityImpact = coordinatorPipeline.slice(
|
||||
coordinatorPipeline.indexOf("'common-security/': ["),
|
||||
coordinatorPipeline.indexOf("'common-openapi/': [")
|
||||
)
|
||||
assert.match(coordinatorPipeline, /def fullRebuildPaths = \[/)
|
||||
assert.match(coordinatorPipeline, /'common-security\/': \[/)
|
||||
assert.match(coordinatorPipeline, /'common-event-contract\/': \[/)
|
||||
assert.match(coordinatorPipeline, /commonPathServices\.each \{ prefix, impactedServices ->/)
|
||||
assert.match(coordinatorPipeline, /selected\.addAll\(impactedServices\)/)
|
||||
assert.match(securityImpact, /'auth'.*'finance'.*'file'/s)
|
||||
assert.doesNotMatch(securityImpact, /gateway|print|integration-service|event-bridge-service/)
|
||||
})
|
||||
|
||||
test('production deployments cannot skip tests', () => {
|
||||
assert.match(coordinatorPipeline, /env\.RESOLVED_ENVIRONMENT == 'production' && params\.SKIP_TESTS/)
|
||||
assert.match(coordinatorPipeline, /error\('生产环境禁止跳过测试'\)/)
|
||||
|
||||
Reference in New Issue
Block a user