nastra commented on code in PR #8918:
URL: https://github.com/apache/iceberg/pull/8918#discussion_r1376012421


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -82,19 +85,64 @@
 import org.apache.iceberg.types.Types;
 import org.apache.iceberg.util.JsonUtil;
 import org.apache.thrift.TException;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
-public class TestHiveCatalog extends HiveMetastoreTest {
+/**
+ * Run all the tests from abstract of {@link CatalogTests}. Also, a few 
specific tests for HIVE too.
+ * There could be some duplicated tests that are already being covered with 
{@link CatalogTests}
+ * //TODO: remove duplicate tests with {@link CatalogTests}.Also use the 
DB/TABLE/SCHEMA from {@link
+ * CatalogTests}
+ */
+public class TestHiveCatalog extends CatalogTests<HiveCatalog> {
   private static ImmutableMap meta =
       ImmutableMap.of(
           "owner", "apache",
           "group", "iceberg",
           "comment", "iceberg  hiveCatalog test");
 
   @TempDir private Path temp;
+  private HiveCatalog catalog;
+  private HiveMetaStoreClient metastoreClient;
+  private HiveConf hiveConf;
+  private static final String DB_NAME = "hivedb";
+
+  @BeforeEach
+  public void before() throws Exception {
+    HiveMetastoreTest.startMetastore(Collections.emptyMap());

Review Comment:
   I'm not a fan of doing setup like this. As I mentioned in 
https://github.com/apache/iceberg/pull/8918#discussion_r1375074020 we should 
have a `HiveMetastoreExtension` that handles setup/teardown of the metastore 
itself. If necessary, the extension can take parameters that it needs to 
properly configure the metastore.
   Then you'd register the extension in the test class itself as described in 
https://junit.org/junit5/docs/current/user-guide/#extensions-registration-programmatic.
   
   I think going forward this is a much cleaner approach



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to