test(M01-B): 验证MySQL迁移往返

This commit is contained in:
Codex
2026-06-18 09:53:10 +08:00
parent 2571f6fe5b
commit 8749a44adf
5 changed files with 208 additions and 0 deletions
+7
View File
@@ -17,7 +17,9 @@ $requiredFiles = @(
"backend/tests/migration-contract.test.mjs",
"backend/tests/mysql-pool-contract.test.mjs",
"backend/tests/migration-runner.test.mjs",
"backend/tests/mysql-migration-roundtrip.test.mjs",
"backend/tests/legacy-read-repository.test.mjs",
"scripts/dev/wsl/mysql-migration-roundtrip.sh",
"database/migrations/2026061601_m01b_core_schema.up.sql",
"database/migrations/2026061601_m01b_core_schema.down.sql",
"database/migrations/2026061601_m01b_core_schema.verify.sql",
@@ -31,6 +33,11 @@ foreach ($path in $requiredFiles) {
}
}
$packageJson = Get-Content "backend/package.json" -Raw | ConvertFrom-Json
if (-not $packageJson.scripts.'test:mysql:migration') {
throw "backend/package.json is missing test:mysql:migration"
}
& npm --prefix backend test
if ($LASTEXITCODE -ne 0) {
throw "backend contract test failed"