Skip to content

Commit

Permalink
feat: TS_INTEGRATION_PRESERVE_TEST_DATABASES flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tomg10 committed Nov 8, 2023
1 parent e583660 commit 49f5119
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/tests/ts-integration/src/context-owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,16 @@ export class TestContextOwner {
if (databaseUrl.trim().length == 0) {
continue; //sanity check, we really don't want sqlx to delete main postgres database
}
await utils.spawn(`cargo sqlx database drop -y --database-url ${databaseUrl}`);
if (process.env.TS_INTEGRATION_PRESERVE_TEST_DATABASES === undefined) {
await utils.spawn(`cargo sqlx database drop -y --database-url ${databaseUrl}`);
} else {
console.log(`skipped cleaning ${databaseUrl}`);
}
} catch (e) {}
}
fs.rmSync(filepath);
if (process.env.TS_INTEGRATION_PRESERVE_TEST_DATABASES === undefined) {
fs.rmSync(filepath);
}
this.reporter.finishAction();
}

Expand Down

0 comments on commit 49f5119

Please sign in to comment.