mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat: Add testcontainers and Playwright (no-changelog) (#16662)
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user