This is an automated email from the ASF dual-hosted git repository.

hongdd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 33c816240 [KYUUBI #2348] Add it test for trino engine
33c816240 is described below

commit 33c816240d3c1eee744bad351c5ae25c54f64139
Author: hongdongdong <[email protected]>
AuthorDate: Thu May 19 16:33:53 2022 +0800

    [KYUUBI #2348] Add it test for trino engine
    
    ### _Why are the changes needed?_
    
    Add it test for trino engine
    
    ### _How was this patch tested?_
    - [X] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [ ] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #2638 from hddong/trino-it.
    
    Closes #2348
    
    cf6b8d5d [hongdongdong] Add IT tests for trino engine
    
    Authored-by: hongdongdong <[email protected]>
    Signed-off-by: hongdongdong <[email protected]>
---
 integration-tests/kyuubi-trino-it/pom.xml          | 99 ++++++++++++++++++++++
 .../trino/WithKyuubiServerAndTrinoContainer.scala  | 53 ++++++++++++
 .../it/trino/operation/TrinoOperationSuite.scala   | 37 ++++++++
 integration-tests/pom.xml                          |  1 +
 4 files changed, 190 insertions(+)

diff --git a/integration-tests/kyuubi-trino-it/pom.xml 
b/integration-tests/kyuubi-trino-it/pom.xml
new file mode 100644
index 000000000..98c111ef1
--- /dev/null
+++ b/integration-tests/kyuubi-trino-it/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>integration-tests</artifactId>
+        <groupId>org.apache.kyuubi</groupId>
+        <version>1.6.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>kyuubi-trino-it_2.12</artifactId>
+    <name>Kyuubi Test Trino IT</name>
+    <url>https://kyuubi.apache.org/</url>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.kyuubi</groupId>
+            <artifactId>kyuubi-common_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.kyuubi</groupId>
+            <artifactId>kyuubi-server_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.kyuubi</groupId>
+            <artifactId>kyuubi-server_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.kyuubi</groupId>
+            <artifactId>kyuubi-hive-jdbc-shaded</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- trino -->
+        <dependency>
+            <groupId>org.apache.kyuubi</groupId>
+            
<artifactId>kyuubi-trino-engine_${scala.binary.version}</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.dimafeng</groupId>
+            
<artifactId>testcontainers-scala-scalatest_${scala.binary.version}</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.dimafeng</groupId>
+            
<artifactId>testcontainers-scala-trino_${scala.binary.version}</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>io.trino</groupId>
+            <artifactId>trino-jdbc</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+</project>
\ No newline at end of file
diff --git 
a/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/WithKyuubiServerAndTrinoContainer.scala
 
b/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/WithKyuubiServerAndTrinoContainer.scala
new file mode 100644
index 000000000..147c12e14
--- /dev/null
+++ 
b/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/WithKyuubiServerAndTrinoContainer.scala
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.it.trino
+
+import com.dimafeng.testcontainers.TrinoContainer
+import com.dimafeng.testcontainers.scalatest.TestContainerForAll
+import org.testcontainers.utility.DockerImageName
+
+import org.apache.kyuubi.WithKyuubiServer
+import org.apache.kyuubi.config.KyuubiConf
+import org.apache.kyuubi.config.KyuubiConf.ENGINE_TRINO_CONNECTION_CATALOG
+import org.apache.kyuubi.config.KyuubiConf.ENGINE_TRINO_CONNECTION_URL
+import org.apache.kyuubi.config.KyuubiConf.ENGINE_TYPE
+
+trait WithKyuubiServerAndTrinoContainer
+  extends WithKyuubiServer with TestContainerForAll {
+
+  final val IMAGE_VERSION = 363
+  final val DOCKER_IMAGE_NAME = s"trinodb/trino:${IMAGE_VERSION}"
+
+  override val containerDef = 
TrinoContainer.Def(DockerImageName.parse(DOCKER_IMAGE_NAME))
+
+  override protected val conf: KyuubiConf = {
+    KyuubiConf()
+      .set(ENGINE_TYPE, "TRINO")
+      .set(ENGINE_TRINO_CONNECTION_CATALOG, "memory")
+  }
+
+  override def beforeAll(): Unit = {
+    // start trino cluster containers
+    withContainers { trinoContainer =>
+      val trinoConnectionUrl = trinoContainer.jdbcUrl.replace("jdbc:trino", 
"http")
+      conf.set(ENGINE_TRINO_CONNECTION_URL, trinoConnectionUrl)
+
+      super.beforeAll()
+    }
+  }
+}
diff --git 
a/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/operation/TrinoOperationSuite.scala
 
b/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/operation/TrinoOperationSuite.scala
new file mode 100644
index 000000000..d7db5ea7f
--- /dev/null
+++ 
b/integration-tests/kyuubi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/operation/TrinoOperationSuite.scala
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.it.trino.operation
+
+import org.apache.kyuubi.engine.trino.TrinoQueryTests
+import org.apache.kyuubi.it.trino.WithKyuubiServerAndTrinoContainer
+
+/**
+ * This test is for Kyuubi Server with Trino engine Running on local:
+ *
+ *                             Real World
+ *  -------------------------------------------------------------      
---------------------
+ *  |            JDBC                                           |      |       
            |
+ *  |  Client    ---->   Kyuubi Server  --> Trino Engine        |  --> |   
Trino Cluster   |
+ *  |                                                           |      |       
            |
+ *  -------------------------------------------------------------      
---------------------
+ */
+class TrinoOperationSuite extends TrinoQueryTests with 
WithKyuubiServerAndTrinoContainer {
+
+  override protected def jdbcUrl: String = getJdbcUrl
+
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index d3134700f..0ad078c5e 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -33,6 +33,7 @@
 
     <modules>
         <module>kyuubi-flink-it</module>
+        <module>kyuubi-trino-it</module>
     </modules>
 
     <profiles>

Reply via email to