提交
This commit is contained in:
@@ -5,6 +5,29 @@ import test from 'node:test'
|
||||
const read = async (path) => (await readFile(new URL(`../${path}`, import.meta.url), 'utf8'))
|
||||
.replaceAll('\r\n', '\n')
|
||||
|
||||
test('local, development and test Nacos publishing remain environment-isolated', async () => {
|
||||
const publisher = await read('scripts/publish-nacos-config.ps1')
|
||||
const local = [
|
||||
await read('config/nacos/local/gateway-overseas.yml'),
|
||||
await read('config/nacos/local/lastleg-service.yml'),
|
||||
await read('config/nacos/local/warehouse-overseas-service.yml'),
|
||||
].join('\n')
|
||||
const remote = [
|
||||
await read('config/nacos/overseas/gateway-overseas.yml'),
|
||||
await read('config/nacos/overseas/lastleg-service.yml'),
|
||||
await read('config/nacos/overseas/warehouse-overseas-service.yml'),
|
||||
].join('\n')
|
||||
|
||||
assert.match(publisher, /ValidateSet\('local', 'dev', 'development', 'test', 'production'\)/)
|
||||
assert.match(publisher, /必须显式指定非 public 的 Nacos namespace/)
|
||||
assert.match(local, /127\.0\.0\.1:9100/)
|
||||
assert.match(local, /127\.0\.0\.1:9303/)
|
||||
assert.doesNotMatch(remote, /127\.0\.0\.1|password:\s*123456/)
|
||||
assert.match(remote, /http:\/\/lastleg-service:9303/)
|
||||
assert.match(remote, /\$\{LASTLEG_DB_URL\}/)
|
||||
assert.match(remote, /\$\{WAREHOUSE_DB_URL\}/)
|
||||
})
|
||||
|
||||
test('Jenkins pipelines recognize all overseas deployable modules', async () => {
|
||||
const controller = await read('Jenkinsfile')
|
||||
const service = await read('Jenkinsfile.service')
|
||||
|
||||
Reference in New Issue
Block a user