Skip to content

Commit

Permalink
Use warehouse_directory_path in TestHdfsSyncPartitionMetadata
Browse files Browse the repository at this point in the history
68ac7c8 changed schema
location. Move setUp and tearDown methods to ABFS because
removing default warhouse directory affects other tests.
  • Loading branch information
ebyhr committed May 19, 2022
1 parent f23b4bd commit 3e95d32
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.tests.product.hive;

import io.trino.tempto.AfterTestWithContext;
import io.trino.tempto.BeforeTestWithContext;
import io.trino.tempto.ProductTest;
import io.trino.tempto.assertions.QueryAssert;
import io.trino.tempto.query.QueryResult;
Expand All @@ -34,19 +32,6 @@
public abstract class BaseTestSyncPartitionMetadata
extends ProductTest
{
@BeforeTestWithContext
public void setUp()
{
removeHdfsDirectory(schemaLocation());
makeHdfsDirectory(schemaLocation());
}

@AfterTestWithContext
public void tearDown()
{
removeHdfsDirectory(schemaLocation());
}

public void testAddPartition()
{
String tableName = "test_sync_partition_metadata_add_partition";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
package io.trino.tests.product.hive;

import io.trino.tempto.AfterTestWithContext;
import io.trino.tempto.BeforeTestWithContext;
import io.trino.testng.services.Flaky;
import org.testng.annotations.Test;

Expand All @@ -33,6 +35,19 @@ public class TestAbfsSyncPartitionMetadata
{
private final String schema = "test_" + randomTableSuffix();

@BeforeTestWithContext
public void setUp()
{
removeHdfsDirectory(schemaLocation());
makeHdfsDirectory(schemaLocation());
}

@AfterTestWithContext
public void tearDown()
{
removeHdfsDirectory(schemaLocation());
}

@Override
protected String schemaLocation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import static io.trino.tests.product.TestGroups.TRINO_JDBC;
import static io.trino.tests.product.hive.HiveProductTest.ERROR_COMMITTING_WRITE_TO_HIVE_ISSUE;
import static io.trino.tests.product.hive.HiveProductTest.ERROR_COMMITTING_WRITE_TO_HIVE_MATCH;
import static io.trino.tests.product.hive.util.TemporaryHiveTable.randomTableSuffix;
import static java.lang.String.format;

public class TestHdfsSyncPartitionMetadata
extends BaseTestSyncPartitionMetadata
Expand All @@ -41,12 +39,10 @@ public class TestHdfsSyncPartitionMetadata
@Inject
private HdfsDataSourceWriter hdfsDataSourceWriter;

private final String schema = "test_" + randomTableSuffix();

@Override
protected String schemaLocation()
{
return format("%s/%s", warehouseDirectory, schema);
return warehouseDirectory;
}

@Test(groups = {HIVE_PARTITIONING, SMOKE, TRINO_JDBC})
Expand Down

0 comments on commit 3e95d32

Please sign in to comment.