Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yikf committed Dec 29, 2023
1 parent 5474ebf commit 3c17d2c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ package org.apache.kyuubi.engine.hive
import org.apache.kyuubi.KyuubiFunSuite
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.engine.deploy.yarn.EngineYarnModeSubmitter.{KYUUBI_ENGINE_DEPLOY_YARN_MODE_HADOOP_CONF_KEY, KYUUBI_ENGINE_DEPLOY_YARN_MODE_HIVE_CONF_KEY, KYUUBI_ENGINE_DEPLOY_YARN_MODE_YARN_CONF_KEY}
import org.apache.kyuubi.engine.hive.HiveProcessBuilder.HIVE_HADOOP_CLASSPATH_KEY

class HiveYarnModeProcessBuilderSuite extends KyuubiFunSuite {

test("hive yarn mode process builder") {
val conf = KyuubiConf().set("kyuubi.on", "off")
val builder = new HiveYarnModeProcessBuilder("kyuubi", conf, "") {
override def env: Map[String, String] = super.env + ("HIVE_CONF_DIR" -> "/etc/hive/conf")
override def env: Map[String, String] =
super.env + ("HIVE_CONF_DIR" -> "/etc/hive/conf") + (HIVE_HADOOP_CLASSPATH_KEY -> "/hadoop")
}
val commands = builder.toString.split('\n')
assert(commands.head.contains("bin/java"), "wrong exec")
Expand All @@ -39,7 +41,9 @@ class HiveYarnModeProcessBuilderSuite extends KyuubiFunSuite {
test("hadoop conf dir") {
val conf = KyuubiConf().set("kyuubi.on", "off")
val builder = new HiveYarnModeProcessBuilder("kyuubi", conf, "") {
override def env: Map[String, String] = super.env + ("HADOOP_CONF_DIR" -> "/etc/hadoop/conf")
override def env: Map[String, String] =
super.env + ("HADOOP_CONF_DIR" -> "/etc/hadoop/conf") +
(HIVE_HADOOP_CLASSPATH_KEY -> "/hadoop")
}
assert(builder.toString.contains(
s"--conf $KYUUBI_ENGINE_DEPLOY_YARN_MODE_HADOOP_CONF_KEY=/etc/hadoop/conf"))
Expand All @@ -49,7 +53,8 @@ class HiveYarnModeProcessBuilderSuite extends KyuubiFunSuite {
val conf = KyuubiConf().set("kyuubi.on", "off")
val builder = new HiveYarnModeProcessBuilder("kyuubi", conf, "") {
override def env: Map[String, String] =
super.env + ("YARN_CONF_DIR" -> "/etc/hadoop/yarn/conf")
super.env + ("YARN_CONF_DIR" -> "/etc/hadoop/yarn/conf") +
(HIVE_HADOOP_CLASSPATH_KEY -> "/hadoop")
}
assert(builder.toString.contains(
s"--conf $KYUUBI_ENGINE_DEPLOY_YARN_MODE_YARN_CONF_KEY=/etc/hadoop/yarn/conf"))
Expand Down

0 comments on commit 3c17d2c

Please sign in to comment.