Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination-redshift: fixed integration tests - added tmp tables removal #22495

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ void setup() {
.withDestinationSyncMode(DestinationSyncMode.APPEND)));
}

@Override
protected void tearDown(final TestDestinationEnv testEnv) throws Exception {
getDatabase().query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE", DATASET_ID)));
super.tearDown(testEnv);
}

@Test
void testIfSuperTmpTableWasCreatedAfterVarcharTmpTable() throws Exception {
setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ void setup() {
.withDestinationSyncMode(DestinationSyncMode.APPEND)));
}

@Override
protected void tearDown(final TestDestinationEnv testEnv) throws Exception {
getDatabase().query(ctx -> ctx.execute(String.format("DROP SCHEMA IF EXISTS %s CASCADE", DATASET_ID)));
super.tearDown(testEnv);
}

@Test
void testIfSuperTmpTableWasCreatedAfterVarcharTmpTableDuringS3Staging() throws Exception {
setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ protected void setup(final TestDestinationEnv testEnv) throws Exception {

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

Expand Down