Skip to content

Commit

Permalink
Don't insert rows in skipTestUnlessSupportsDeletes
Browse files Browse the repository at this point in the history
An empty table is sufficient to verify the connector behavior.
  • Loading branch information
ebyhr committed Feb 25, 2022
1 parent 50fbb46 commit a63fe98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public void testDeleteWithVarcharPredicate()
protected void skipTestUnlessSupportsDeletes()
{
skipTestUnless(supportsCreateTable());
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "(col varchar(1))", ImmutableList.of("'a'", "'A'"))) {
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "(col varchar(1))")) {
if (!supportsDelete()) {
assertQueryFails("DELETE FROM " + table.getName(), "This connector does not support deletes");
throw new SkipException("This connector does not support deletes");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ public void verifySupportsDeleteDeclaration()
}

skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE));
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "AS SELECT * FROM region")) {
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "(regionkey int)")) {
assertQueryFails("DELETE FROM " + table.getName(), "This connector does not support deletes");
}
}
Expand All @@ -1312,7 +1312,7 @@ public void verifySupportsRowLevelDeleteDeclaration()
}

skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE));
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_row_level_delete", "AS SELECT * FROM region")) {
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_row_level_delete", "(regionkey int)")) {
assertQueryFails("DELETE FROM " + table.getName() + " WHERE regionkey = 2", "This connector does not support deletes");
}
}
Expand Down

0 comments on commit a63fe98

Please sign in to comment.