Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 cf6b8d5 [hongdongdong] Add IT tests for trino engine Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com> Signed-off-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
- Loading branch information
Showing
4 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
53 changes: 53 additions & 0 deletions
53
...rino-it/src/test/scala/org/apache/kyuubi/it/trino/WithKyuubiServerAndTrinoContainer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...bi-trino-it/src/test/scala/org/apache/kyuubi/it/trino/operation/TrinoOperationSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
|
||
<modules> | ||
<module>kyuubi-flink-it</module> | ||
<module>kyuubi-trino-it</module> | ||
</modules> | ||
|
||
<profiles> | ||
|