You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/04/14 05:52:30 UTC

[GitHub] [incubator-kyuubi] zwangsheng commented on a diff in pull request #2359: [Test] Build WithKyuubiServerOnKuberntes

zwangsheng commented on code in PR #2359:
URL: https://github.com/apache/incubator-kyuubi/pull/2359#discussion_r850104452


##########
integration-tests/kyuubi-kubernetes-it/src/test/scala/org/apache/kyuubi/kubernetes/test/deployment/KyuubiOnKubernetesTestsSuite.scala:
##########
@@ -31,34 +31,11 @@ import org.apache.kyuubi.operation.SparkQueryTests
  *  |          |         |                                                   |
  *  ------------         -----------------------------------------------------
  */
-class KyuubiOnKubernetesTestsSuite extends SparkQueryTests with Logging {
-  private lazy val _jdbcUrl: String = {
-    val kubernetesclient = MiniKube.getKubernetesClient
-    val kyuubiServers =
-      kubernetesclient
-        .pods()
-        .list()
-        .getItems
-    assert(kyuubiServers.size() == 1)
-    val kyuubiServer = kyuubiServers.get(0)
-    // Kyuubi server state should be running since mvn compile is quite slowly..
-    if (!"running".equalsIgnoreCase(kyuubiServer.getStatus.getPhase)) {
-      val log =
-        kubernetesclient
-          .pods()
-          .withName(kyuubiServer.getMetadata.getName)
-          .getLog
-      throw new IllegalStateException(
-        s"Kyuubi server pod state error: ${kyuubiServer.getStatus.getPhase}, log:\n$log")
-    }
-    val kyuubiServerIp = MiniKube.getIp
-    val kyuubiServerPort =
-      kyuubiServer.getSpec.getContainers.get(0).getPorts.get(0).getHostPort
-    s"jdbc:hive2://$kyuubiServerIp:$kyuubiServerPort/;"
-  }
+class KyuubiOnKubernetesTestsSuite extends WithKyuubiServerOnKubernetes with SparkQueryTests {
+  override protected val kyuubiServerConf: KyuubiConf = KyuubiConf()
+  override protected val connectionConf: Map[String, String] = Map(
+    "spark.master" -> "local",
+    "spark.executor.instances" -> "1")
 
-  override protected def jdbcUrl: String = {
-    assert(_jdbcUrl != null, "Failed to get Kyuubi server")
-    _jdbcUrl
-  }
+  override protected def jdbcUrl: String = getJdbcUrl

Review Comment:
   This method required by `JDBCTestHelper`, pass by `SparkQueryTests`, should be here.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org