Skip to content

Commit 3d2a995

Browse files
authored
[18202] Destination-redshift: fixed tmp test tables removal in integration tests (#22495)
1 parent 6f0c0be commit 3d2a995

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

airbyte-integrations/connectors/destination-redshift/src/test-integration/java/io/airbyte/integrations/destination/redshift/RedshiftInsertDestinationAcceptanceTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ void setup() {
7878
.withDestinationSyncMode(DestinationSyncMode.APPEND)));
7979
}
8080

81+
@Override
82+
protected void tearDown(final TestDestinationEnv testEnv) throws Exception {
83+
getDatabase().query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE", DATASET_ID)));
84+
super.tearDown(testEnv);
85+
}
86+
8187
@Test
8288
void testIfSuperTmpTableWasCreatedAfterVarcharTmpTable() throws Exception {
8389
setup();

airbyte-integrations/connectors/destination-redshift/src/test-integration/java/io/airbyte/integrations/destination/redshift/RedshiftS3StagingInsertDestinationAcceptanceTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ void setup() {
7474
.withDestinationSyncMode(DestinationSyncMode.APPEND)));
7575
}
7676

77+
@Override
78+
protected void tearDown(final TestDestinationEnv testEnv) throws Exception {
79+
getDatabase().query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE", DATASET_ID)));
80+
super.tearDown(testEnv);
81+
}
82+
7783
@Test
7884
void testIfSuperTmpTableWasCreatedAfterVarcharTmpTableDuringS3Staging() throws Exception {
7985
setup();

airbyte-integrations/connectors/destination-redshift/src/test-integration/java/io/airbyte/integrations/destination/redshift/RedshiftStagingS3DestinationAcceptanceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected void setup(final TestDestinationEnv testEnv) throws Exception {
215215

216216
@Override
217217
protected void tearDown(final TestDestinationEnv testEnv) throws Exception {
218-
final String dropSchemaQuery = String.format("DROP SCHEMA IF EXISTS %s CASCADE", config.get("schema").asText());
218+
getDatabase().query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE", config.get("schema").asText())));
219219
getDatabase().query(ctx -> ctx.execute(String.format("drop user if exists %s;", USER_WITHOUT_CREDS)));
220220
}
221221

0 commit comments

Comments
 (0)