Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #3239] [Subtask] DorisSQLEngine - Add integration tests
### _Why are the changes needed?_ close #3239 (comment) ### _How was this patch tested?_ - [ ] 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 #3240 from zhaomin1423/jdbc_it. Closes #3239 8da64f2 [Min] fix it 24cceba [Min] add dependency b477326 [Min] add server to dependency e74aa93 [Min] fix getJdbcUrl conflict 01e6a30 [Min] [KYUUBI #3239] [Subtask] DorisSQLEngine - Add integration tests Authored-by: Min <zhaomin1423@163.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
- Loading branch information
1 parent
ecda418
commit 3cf5a20
Showing
14 changed files
with
265 additions
and
8 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
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
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
24 changes: 24 additions & 0 deletions
24
...-engine/src/test/scala/org/apache/kyuubi/engine/jdbc/doris/OperationWithEngineSuite.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,24 @@ | ||
/* | ||
* 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.engine.jdbc.doris | ||
|
||
import org.apache.kyuubi.operation.HiveJDBCTestHelper | ||
|
||
class OperationWithEngineSuite extends DorisOperationSuite with HiveJDBCTestHelper { | ||
|
||
override protected def jdbcUrl: String = jdbcConnectionUrl | ||
} |
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
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
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
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,85 @@ | ||
<?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> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>kyuubi-jdbc-it_2.12</artifactId> | ||
<name>Kyuubi Test Jdbc 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-jdbc-engine_${scala.binary.version}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.kyuubi</groupId> | ||
<artifactId>kyuubi-jdbc-engine_${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>com.dimafeng</groupId> | ||
<artifactId>testcontainers-scala-scalatest_${scala.binary.version}</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
35 changes: 35 additions & 0 deletions
35
integration-tests/kyuubi-jdbc-it/src/test/resources/doris-compose.yml
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,35 @@ | ||
# 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. | ||
|
||
version: "3" | ||
services: | ||
doris-fe: | ||
# https://hub.docker.com/repository/docker/zhaomin1423/doris-fe | ||
image: zhaomin1423/doris-fe:1.0.0 | ||
ports: | ||
- "9030" | ||
|
||
doris-be: | ||
# https://hub.docker.com/repository/docker/zhaomin1423/doris-be | ||
image: zhaomin1423/doris-be:1.0.0-0.1 | ||
ports: | ||
- "8040" | ||
depends_on: | ||
- doris-fe | ||
entrypoint: /opt/entrypoint.sh | ||
|
||
|
43 changes: 43 additions & 0 deletions
43
integration-tests/kyuubi-jdbc-it/src/test/resources/log4j2-test.xml
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,43 @@ | ||
<?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. | ||
--> | ||
|
||
<!-- Extra logging related to initialization of Log4j. | ||
Set to debug or trace if log4j initialization is failing. --> | ||
<Configuration status="WARN"> | ||
<Appenders> | ||
<Console name="stdout" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="%d{HH:mm:ss.SSS} %p %c: %m%n"/> | ||
<Filters> | ||
<ThresholdFilter level="FATAL"/> | ||
<RegexFilter regex=".*Thrift error occurred during processing of message.*" onMatch="DENY" onMismatch="NEUTRAL"/> | ||
</Filters> | ||
</Console> | ||
<File name="file" fileName="target/unit-tests.log"> | ||
<PatternLayout pattern="%d{HH:mm:ss.SSS} %t %p %c{1}: %m%n"/> | ||
<Filters> | ||
<RegexFilter regex=".*Thrift error occurred during processing of message.*" onMatch="DENY" onMismatch="NEUTRAL"/> | ||
</Filters> | ||
</File> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="stdout"/> | ||
<AppenderRef ref="file"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
Binary file added
BIN
+2.4 MB
integration-tests/kyuubi-jdbc-it/src/test/resources/mysql/mysql-connector-java-8.0.30.jar
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
...ubi-jdbc-it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/OperationWithServerSuite.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,26 @@ | ||
/* | ||
* 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.jdbc.doris | ||
|
||
import org.apache.kyuubi.engine.jdbc.doris.DorisOperationSuite | ||
|
||
class OperationWithServerSuite extends DorisOperationSuite with WithKyuubiServerAndDorisContainer { | ||
|
||
override protected def jdbcUrl: String = getJdbcUrl | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/WithKyuubiServerAndDorisContainer.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,44 @@ | ||
/* | ||
* 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.jdbc.doris | ||
|
||
import org.apache.kyuubi.{Utils, WithKyuubiServer} | ||
import org.apache.kyuubi.config.KyuubiConf | ||
import org.apache.kyuubi.config.KyuubiConf.{ENGINE_JDBC_EXTRA_CLASSPATH, KYUUBI_ENGINE_ENV_PREFIX, KYUUBI_HOME} | ||
import org.apache.kyuubi.engine.jdbc.doris.WithDorisEngine | ||
|
||
trait WithKyuubiServerAndDorisContainer extends WithKyuubiServer with WithDorisEngine { | ||
|
||
private val kyuubiHome: String = Utils | ||
.getCodeSourceLocation(getClass).split("integration-tests").head | ||
|
||
override protected val conf: KyuubiConf = { | ||
KyuubiConf() | ||
.set(s"$KYUUBI_ENGINE_ENV_PREFIX.$KYUUBI_HOME", kyuubiHome) | ||
.set( | ||
ENGINE_JDBC_EXTRA_CLASSPATH, | ||
getClass.getClassLoader.getResource( | ||
"mysql/mysql-connector-java-8.0.30.jar").toURI.getPath) | ||
} | ||
|
||
override def beforeAll(): Unit = { | ||
val configs = withKyuubiConf | ||
configs.foreach(config => conf.set(config._1, config._2)) | ||
super.beforeAll() | ||
} | ||
} |
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