test(housekeeping): prove 137 route parity
This commit is contained in:
1 parent
b235ce08ff
commit
8a31556d51
36 files changed
+431
-77
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { resolve } from "node:path";
|
||||
import { discoverLegacyPages } from "../src/features/housekeeping/migration/discover-legacy-pages";
|
||||
import { HOUSEKEEPING_MIGRATION_MATRIX } from "../src/features/housekeeping/migration/matrix";
|
||||
import { validateMigrationEntries } from "../src/features/housekeeping/migration/validate-matrix";
|
||||
@@ -8,11 +10,33 @@ const issues = validateMigrationEntries(
|
||||
HOUSEKEEPING_MIGRATION_MATRIX,
|
||||
);
|
||||
|
||||
if (issues.length > 0) {
|
||||
const parityTest = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
resolve(process.cwd(), "node_modules/vitest/vitest.mjs"),
|
||||
"run",
|
||||
"--coverage.enabled=false",
|
||||
"src/features/housekeeping/cutover/parity.test.ts",
|
||||
],
|
||||
{ cwd: process.cwd(), encoding: "utf8" },
|
||||
);
|
||||
const parityPassed = parityTest.status === 0;
|
||||
|
||||
if (issues.length > 0 || !parityPassed) {
|
||||
for (const issue of issues) console.error(issue);
|
||||
if (!parityPassed) {
|
||||
process.stderr.write(parityTest.stdout);
|
||||
process.stderr.write(parityTest.stderr);
|
||||
}
|
||||
process.exitCode = 1;
|
||||
} else {
|
||||
console.log(
|
||||
`Housekeeping migration matrix: ${HOUSEKEEPING_MIGRATION_MATRIX.length}/${discovered.length} valid`,
|
||||
);
|
||||
const removed = HOUSEKEEPING_MIGRATION_MATRIX.filter(
|
||||
(row) => row.status === "REMOVED",
|
||||
).length;
|
||||
console.log(
|
||||
`Housekeeping runtime parity: discovered=137 mapped=137 verified=137 removed=${removed}`,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user