fix(phase4): harden development acceptance adapters
This commit is contained in:
@@ -30,10 +30,10 @@ const overseasGateway = normalizeOrigin(option('--overseas-gateway') || process.
|
||||
const password = acceptancePassword()
|
||||
if (!password) throw new Error('缺少 CHONGCHONG_ADMIN_ACCEPTANCE_PASSWORD 或本机开发验收凭据文件')
|
||||
|
||||
const executable = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm'
|
||||
const result = spawnSync(executable, ['exec', 'vitest', 'run', '--config', 'vitest.phase4-development.config.ts'], {
|
||||
const result = spawnSync('pnpm', ['exec', 'vitest', 'run', '--config', 'vitest.phase4-development.config.ts'], {
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
shell: process.platform === 'win32',
|
||||
env: {
|
||||
...process.env,
|
||||
ADMIN_PHASE4_LIVE: '1',
|
||||
@@ -45,4 +45,5 @@ const result = spawnSync(executable, ['exec', 'vitest', 'run', '--config', 'vite
|
||||
VITE_OVERSEAS_API_BASE_URL: `${overseasGateway}/api`,
|
||||
},
|
||||
})
|
||||
if (result.error) throw result.error
|
||||
process.exit(result.status ?? 1)
|
||||
|
||||
@@ -10,6 +10,8 @@ test('development runner requires an explicit development environment and gatewa
|
||||
assert.match(runner, /environment !== 'development'/)
|
||||
assert.match(runner, /--gateway/)
|
||||
assert.match(runner, /--overseas-gateway/)
|
||||
assert.match(runner, /shell: process\.platform === 'win32'/)
|
||||
assert.match(runner, /if \(result\.error\) throw result\.error/)
|
||||
assert.doesNotMatch(runner, /ADMIN_ACCEPTANCE_PASSWORD\s*[:=]\s*['"][^'"]+['"]/)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user