feat: Add testcontainers and Playwright (no-changelog) (#16662)

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
shortstacked
2025-07-01 14:15:31 +01:00
committed by GitHub
parent 422aa82524
commit 852657c17e
52 changed files with 5686 additions and 1111 deletions

View File

@@ -229,14 +229,20 @@ export class E2EController {
}
private async truncateAll() {
const { connection } = this.settingsRepo.manager;
const dbType = connection.options.type;
for (const table of tablesToTruncate) {
try {
const { connection } = this.settingsRepo.manager;
await connection.query(
`DELETE FROM ${table}; DELETE FROM sqlite_sequence WHERE name=${table};`,
);
if (dbType === 'postgres') {
await connection.query(`TRUNCATE TABLE "${table}" RESTART IDENTITY CASCADE;`);
} else {
await connection.query(`DELETE FROM "${table}";`);
if (dbType === 'sqlite') {
await connection.query(`DELETE FROM sqlite_sequence WHERE name = '${table}';`);
}
}
} catch (error) {
Container.get(Logger).warn('Dropping Table for E2E Reset error', {
Container.get(Logger).warn(`Dropping Table "${table}" for E2E Reset error`, {
error: error as Error,
});
}