Skip to content

Commit

Permalink
[Improve][connector-e2e][Hive]Optimize script and method names (#8249)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshenghang authored Dec 9, 2024
1 parent 082814d commit b74adb1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,15 @@ private void executeJob(TestContainer container, String job1, String job2)
}

@TestTemplate
public void testFakeSinkHive(TestContainer container) throws Exception {
executeJob(container, "/fake_to_hive.conf", "/hive_to_assert.conf");
}

@TestTemplate
@Disabled(
"[HDFS/COS/OSS/S3] is not available in CI, if you want to run this test, please set up your own environment in the test case file, hadoop_hive_conf_path_local and ip below}")
public void testFakeSinkHiveOnHDFS(TestContainer container) throws Exception {
executeJob(container, "/fake_to_hive_on_hdfs.conf", "/hive_on_hdfs_to_assert.conf");
// TODO Add the test case for Hive on HDFS
}

@TestTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,34 +288,41 @@ private void executeJob(TestContainer container, String job1, String job2)
}

@Test
public void testFakeSinkHiveOnHDFS() throws Exception {
public void testFakeSinkHive() throws Exception {
copyAbsolutePathToContainer("/tmp/hive.keytab", "/tmp/hive.keytab");
copyFileToContainer("/kerberos/krb5.conf", "/tmp/krb5.conf");
copyFileToContainer("/kerberos/hive-site.xml", "/tmp/hive-site.xml");

Container.ExecResult fakeToHiveWithKerberosResult =
executeJob("/fake_to_hive_on_hdfs_with_kerberos.conf");
executeJob("/fake_to_hive_with_kerberos.conf");
Assertions.assertEquals(0, fakeToHiveWithKerberosResult.getExitCode());

Container.ExecResult hiveToAssertWithKerberosResult =
executeJob("/hive_on_hdfs_to_assert_with_kerberos.conf");
executeJob("/hive_to_assert_with_kerberos.conf");
Assertions.assertEquals(0, hiveToAssertWithKerberosResult.getExitCode());

Container.ExecResult fakeToHiveResult = executeJob("/fake_to_hive_on_hdfs.conf");
Container.ExecResult fakeToHiveResult = executeJob("/fake_to_hive.conf");
Assertions.assertEquals(1, fakeToHiveResult.getExitCode());
Assertions.assertTrue(
fakeToHiveResult
.getStderr()
.contains("Get hive table information from hive metastore service failed"));

Container.ExecResult hiveToAssertResult = executeJob("/hive_on_hdfs_to_assert.conf");
Container.ExecResult hiveToAssertResult = executeJob("/hive_to_assert.conf");
Assertions.assertEquals(1, hiveToAssertResult.getExitCode());
Assertions.assertTrue(
hiveToAssertResult
.getStderr()
.contains("Get hive table information from hive metastore service failed"));
}

@TestTemplate
@Disabled(
"[HDFS/COS/OSS/S3] is not available in CI, if you want to run this test, please set up your own environment in the test case file, hadoop_hive_conf_path_local and ip below}")
public void testFakeSinkHiveOnHDFS(TestContainer container) throws Exception {
// TODO Add the test case for Hive on HDFS
}

@TestTemplate
@Disabled(
"[HDFS/COS/OSS/S3] is not available in CI, if you want to run this test, please set up your own environment in the test case file, hadoop_hive_conf_path_local and ip below}")
Expand Down

0 comments on commit b74adb1

Please sign in to comment.