Skip to content

Commit ba8a695

Browse files
committed
test(server): preserve databases when dev seed migrations clash
1 parent 806c498 commit ba8a695

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎apps/server/scripts/migrate-dev-db.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,21 @@ it.layer(NodeServices.layer)("migrate-dev-db", (it) => {
302302
}),
303303
);
304304

305+
const destination = yield* createFixtureSource(destDir);
306+
const sourceBefore = yield* fs.readFile(source);
307+
const destinationBefore = yield* fs.readFile(destination);
308+
305309
const error = yield* runMigrateDevDb(
306310
{ baseDir: destDir, source, projects: 5, threadsPerProject: 2 },
307311
{ sharedHome: sourceDir },
308312
).pipe(Effect.flip);
309313
assert.equal(error._tag, "MigrateDevDbPhaseError");
310314
if (error._tag === "MigrateDevDbPhaseError") {
311315
assert.equal(error.phase, "migrate");
316+
assert.include(String(error.cause), "60_ThreadSnapshotWindowIndexes");
312317
}
318+
assert.deepStrictEqual(yield* fs.readFile(source), sourceBefore);
319+
assert.deepStrictEqual(yield* fs.readFile(destination), destinationBefore);
313320
}),
314321
);
315322

0 commit comments

Comments
 (0)