diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/extensions/AfterAllCleanUpExtension.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/extensions/AfterAllCleanUpExtension.java index a4665ad9a1bc..142709417a44 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/extensions/AfterAllCleanUpExtension.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/extensions/AfterAllCleanUpExtension.java @@ -8,8 +8,6 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit.jupiter.SpringExtension; -import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllExtensions; -import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllRoutines; import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllTables; import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteKeysWithPattern; @@ -38,8 +36,8 @@ public void afterAll(ExtensionContext context) { log.debug("Cleaning up after all tests for {}", testClass.getName()); deleteAllTables(jdbcTemplate); - deleteAllExtensions(jdbcTemplate); - deleteAllRoutines(jdbcTemplate); + // deleteAllExtensions(jdbcTemplate); + // deleteAllRoutines(jdbcTemplate); deleteKeysWithPattern("tenant:.*", reactiveRedisTemplate).block(); } } diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/testhelpers/cleanup/DBCleanup.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/testhelpers/cleanup/DBCleanup.java index 2cf36d4eb906..e9fe4b314909 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/testhelpers/cleanup/DBCleanup.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/testhelpers/cleanup/DBCleanup.java @@ -12,10 +12,11 @@ public class DBCleanup { public static void deleteAllTables(JdbcTemplate jdbcTemplate) { List tableNames = jdbcTemplate.queryForList( - "SELECT tablename FROM pg_tables WHERE schemaname = 'appsmith'", String.class); + "SELECT tablename FROM pg_tables WHERE schemaname = 'appsmith' AND tablename NOT IN ('user', 'tenant', 'flyway_schema_history', 'theme', 'config', 'permission_group')", + String.class); for (String tableName : tableNames) { - jdbcTemplate.execute("DROP TABLE IF EXISTS \"" + tableName + "\" CASCADE"); + jdbcTemplate.execute("TRUNCATE TABLE \"" + tableName + "\" CASCADE"); } }