rkirtir commented on code in PR #4791:
URL: https://github.com/apache/hive/pull/4791#discussion_r1356040552


##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolForMetastore.java:
##########
@@ -467,6 +471,18 @@ public void testMetastoreDbPropertiesAfterUpgrade() throws 
HiveMetaException, IO
     validateMetastoreDbPropertiesTable();
   }
 
+  @Test
+  public void testValidateHiveShortVersion() {
+    String hiveShortVersion = MetastoreVersionInfo.getShortVersion();
+    String hiveVersion = MetastoreVersionInfo.getVersion();
+    Assert.assertEquals(hiveVersion, StringUtils.join(hiveShortVersion, 
"-SNAPSHOT"));
+    Assert.assertTrue(hiveVersion.startsWith(hiveShortVersion));
+    String fileName = 
Stream.of("src/test/resources/sql/postgres/upgrade-3.1.3000-to-" , 
hiveShortVersion ,".postgres.sql").
+            collect(Collectors.joining());
+    File file = new File(fileName);
+    Assert.assertTrue(file.exists());

Review Comment:
   
   This assertion tried to avoid PostgresTPCDS rule failure because of wrong 
file lookup of upgrade scripts. But agree to the point that we need to have it 
for all DBs with install and upgrade scripts where  we need to add all install 
upgrade scripts under sql/db/.. . Probably seprate jira ticket?
   
   Please suggest if I can add these assertions for all dbs in new class 
something like ->TestDbInstallBase . 
   
   PS- there is rule for mariadb but no test for it . Even if adding test needs 
further investigation as it fails with mariaDb 10.2 image.  
   



-- 
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: gitbox-unsubscr...@hive.apache.org

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


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

Reply via email to