test: make release gates portable on Windows
This commit is contained in:
parent
343b88cb98
commit
b2aac04c13
@ -53,7 +53,8 @@ describe('production video transcode drain gate', () => {
|
|||||||
let script: string
|
let script: string
|
||||||
|
|
||||||
beforeAll(async () => {
|
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,再启动候选容器', () => {
|
test('先设置旧容器两类后台 worker drain 并确认 inactive,再启动候选容器', () => {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { spawnSync } from 'node:child_process'
|
|||||||
import test from 'node:test'
|
import test from 'node:test'
|
||||||
|
|
||||||
const scriptPath = path.join(process.cwd(), 'scripts', 'legacy-worker-bootstrap-deploy.ps1')
|
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) {
|
function indexAfter(needle, after = 0) {
|
||||||
const index = script.indexOf(needle, after)
|
const index = script.indexOf(needle, after)
|
||||||
|
|||||||
@ -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`,
|
`${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 startMarker = 'node --input-type=commonjs - "$HOST_RESULT_FILE" "$HOST_BACKUP_DIR" <<\'NODE\'\n'
|
||||||
const start = sop.indexOf(startMarker)
|
const start = sop.indexOf(startMarker)
|
||||||
assert.ok(start >= 0, 'SOP evidence extraction Node block is missing')
|
assert.ok(start >= 0, 'SOP evidence extraction Node block is missing')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user