test: make release gates portable on Windows

This commit is contained in:
chenpei 2026-08-12 20:43:09 +08:00
parent 343b88cb98
commit b2aac04c13
3 changed files with 5 additions and 3 deletions

View File

@ -53,7 +53,8 @@ describe('production video transcode drain gate', () => {
let script: string
beforeAll(async () => {
script = await readFile(path.join(process.cwd(), 'scripts/git-incremental-deploy.ps1'), 'utf8')
script = (await readFile(path.join(process.cwd(), 'scripts/git-incremental-deploy.ps1'), 'utf8'))
.replace(/\r\n/g, '\n')
})
test('先设置旧容器两类后台 worker drain 并确认 inactive,再启动候选容器', () => {

View File

@ -6,7 +6,7 @@ import { spawnSync } from 'node:child_process'
import test from 'node:test'
const scriptPath = path.join(process.cwd(), 'scripts', 'legacy-worker-bootstrap-deploy.ps1')
const script = readFileSync(scriptPath, 'utf8')
const script = readFileSync(scriptPath, 'utf8').replace(/\r\n/g, '\n')
function indexAfter(needle, after = 0) {
const index = script.indexOf(needle, after)

View File

@ -298,7 +298,8 @@ test('SOP extracts the exact receipt basename and hash from a real helper result
`${JSON.stringify(result, null, 2)}\nProduction backup was created, restored to the isolated server and verified.\n`,
)
const sop = await readFile(new URL('../docs/生产数据库安全增量迁移SOP-2026-08-12.md', import.meta.url), 'utf8')
const sop = (await readFile(new URL('../docs/生产数据库安全增量迁移SOP-2026-08-12.md', import.meta.url), 'utf8'))
.replace(/\r\n/g, '\n')
const startMarker = 'node --input-type=commonjs - "$HOST_RESULT_FILE" "$HOST_BACKUP_DIR" <<\'NODE\'\n'
const start = sop.indexOf(startMarker)
assert.ok(start >= 0, 'SOP evidence extraction Node block is missing')