Skip to content

Commit

Permalink
Clean up test schema in connector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anusudarsan committed Jan 28, 2025
1 parent 57a8c6c commit 61a3000
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,15 @@ public void testCreateSchema()
return;
}

assertUpdate(createSchemaSql(schemaName));
assertThat(query("SHOW SCHEMAS"))
.skippingTypesCheck()
.containsAll(format("VALUES '%s', '%s'", getSession().getSchema().orElseThrow(), schemaName));
assertUpdate("DROP SCHEMA " + schemaName);
try {
assertUpdate(createSchemaSql(schemaName));
assertThat(query("SHOW SCHEMAS"))
.skippingTypesCheck()
.containsAll(format("VALUES '%s', '%s'", getSession().getSchema().orElseThrow(), schemaName));
}
finally {
assertUpdate("DROP SCHEMA IF EXISTS " + schemaName);
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3527,11 +3527,15 @@ public void testCreateSchemaWithNonLowercaseOwnerName()
.setIdentity(Identity.ofUser("ADMIN"))
.build();
String schemaName = "test_schema_create_uppercase_owner_name_" + randomNameSuffix();
assertUpdate(newSession, createSchemaSql(schemaName));
assertThat(query(newSession, "SHOW SCHEMAS"))
.skippingTypesCheck()
.containsAll(format("VALUES '%s'", schemaName));
assertUpdate(newSession, "DROP SCHEMA " + schemaName);
try {
assertUpdate(newSession, createSchemaSql(schemaName));
assertThat(query(newSession, "SHOW SCHEMAS"))
.skippingTypesCheck()
.containsAll(format("VALUES '%s'", schemaName));
}
finally {
assertUpdate(newSession, "DROP SCHEMA IF EXISTS " + schemaName);
}
}

@Test
Expand Down

0 comments on commit 61a3000

Please sign in to comment.