优化
This commit is contained in:
@@ -4,6 +4,8 @@ import test from 'node:test'
|
||||
|
||||
const pipeline = (await readFile(new URL('../Jenkinsfile.service', import.meta.url), 'utf8'))
|
||||
.replaceAll('\r\n', '\n')
|
||||
const coordinatorPipeline = (await readFile(new URL('../Jenkinsfile', import.meta.url), 'utf8'))
|
||||
.replaceAll('\r\n', '\n')
|
||||
const directDeployScript = (await readFile(new URL('../deploy/scripts/deploy-built-service.sh', import.meta.url), 'utf8'))
|
||||
.replaceAll('\r\n', '\n')
|
||||
const ciMavenSettings = (await readFile(new URL('../deploy/maven/settings-ci.xml', import.meta.url), 'utf8'))
|
||||
@@ -16,6 +18,13 @@ test('test deployments compile packages without rerunning the full unit test sui
|
||||
assert.doesNotMatch(pipeline, /-Dmaven\.test\.skip=true/)
|
||||
})
|
||||
|
||||
test('coordinator jobs present their own deployment environment as the default choice', () => {
|
||||
assert.match(coordinatorPipeline, /jobBaseName == 'backend-java-dev'/)
|
||||
assert.match(coordinatorPipeline, /\? \['development', 'test', 'staging', 'production'\]/)
|
||||
assert.match(coordinatorPipeline, /: \['test', 'development', 'staging', 'production'\]/)
|
||||
assert.match(coordinatorPipeline, /environmentChoicesForJob\(env\.JOB_BASE_NAME\)/)
|
||||
})
|
||||
|
||||
test('production deployments cannot skip tests', () => {
|
||||
assert.match(pipeline, /params\.ENVIRONMENT == 'production' && params\.SKIP_TESTS/)
|
||||
assert.match(pipeline, /error\('生产环境禁止跳过测试'\)/)
|
||||
|
||||
Reference in New Issue
Block a user