This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/branch-1.6 by this push:
new aa8c93264 [KYUUBI #3715] Remove unexpected mysql connector jar
aa8c93264 is described below
commit aa8c93264e2be7acdcfd445f967e6442d7a376da
Author: Cheng Pan <[email protected]>
AuthorDate: Sat Oct 29 10:22:58 2022 +0000
[KYUUBI #3715] Remove unexpected mysql connector jar
Fix #3715.
It was added in https://github.com/apache/incubator-kyuubi/pull/3240, and I
didn't notice a binary Jar was shipped in the patch, and the worse thing is it
was included in the source release tarball.
- [ ] Add some test cases that check the changes thoroughly including
negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
locally before make a pull request
Closes #3716 from pan3793/mysql.
Closes #3715
0fdcac98 [Cheng Pan] fix
833d4679 [Cheng Pan] nit
5d098397 [Cheng Pan] [KYUUBI #3715] Remove unexpected mysql connector jar
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit 689cbe2c18613aca43d16aa2db4f5c76b711c706)
Signed-off-by: Cheng Pan <[email protected]>
---
integration-tests/kyuubi-jdbc-it/pom.xml | 33 +++++++++++++++++++--
.../mysql/mysql-connector-java-8.0.30.jar | Bin 2513563 -> 0 bytes
.../doris/WithKyuubiServerAndDorisContainer.scala | 23 +++++++++++---
3 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/integration-tests/kyuubi-jdbc-it/pom.xml
b/integration-tests/kyuubi-jdbc-it/pom.xml
index 983dae84b..f157542c7 100644
--- a/integration-tests/kyuubi-jdbc-it/pom.xml
+++ b/integration-tests/kyuubi-jdbc-it/pom.xml
@@ -22,6 +22,7 @@
<artifactId>integration-tests</artifactId>
<groupId>org.apache.kyuubi</groupId>
<version>1.6.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -30,7 +31,6 @@
<url>https://kyuubi.apache.org/</url>
<dependencies>
-
<dependency>
<groupId>org.apache.kyuubi</groupId>
<artifactId>kyuubi-common_${scala.binary.version}</artifactId>
@@ -79,7 +79,34 @@
<artifactId>testcontainers-scala-scalatest_${scala.binary.version}</artifactId>
<scope>test</scope>
</dependency>
-
</dependencies>
-</project>
\ No newline at end of file
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>mysql</groupId>
+
<artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.jdbc.version}</version>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/integration-tests/kyuubi-jdbc-it/src/test/resources/mysql/mysql-connector-java-8.0.30.jar
b/integration-tests/kyuubi-jdbc-it/src/test/resources/mysql/mysql-connector-java-8.0.30.jar
deleted file mode 100644
index 92ebe1b54..000000000
Binary files
a/integration-tests/kyuubi-jdbc-it/src/test/resources/mysql/mysql-connector-java-8.0.30.jar
and /dev/null differ
diff --git
a/integration-tests/kyuubi-jdbc-it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/WithKyuubiServerAndDorisContainer.scala
b/integration-tests/kyuubi-jdbc-it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/WithKyuubiServerAndDorisContainer.scala
index ef41108ae..7b0516197 100644
---
a/integration-tests/kyuubi-jdbc-it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/WithKyuubiServerAndDorisContainer.scala
+++
b/integration-tests/kyuubi-jdbc-it/src/test/scala/org/apache/kyuubi/it/jdbc/doris/WithKyuubiServerAndDorisContainer.scala
@@ -17,6 +17,8 @@
package org.apache.kyuubi.it.jdbc.doris
+import java.nio.file.{Files, Path, Paths}
+
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}
@@ -27,13 +29,26 @@ trait WithKyuubiServerAndDorisContainer extends
WithKyuubiServer with WithDorisE
private val kyuubiHome: String = Utils
.getCodeSourceLocation(getClass).split("integration-tests").head
+ private val mysqlJdbcConnectorPath: String = {
+ val keyword = "mysql-connector"
+
+ val jarsDir = Paths.get(kyuubiHome)
+ .resolve("integration-tests")
+ .resolve("kyuubi-jdbc-it")
+ .resolve("target")
+
+ Files.list(jarsDir)
+ .filter { p: Path => p.getFileName.toString contains keyword }
+ .findFirst
+ .orElseThrow { () => new IllegalStateException(s"Can not find $keyword
in $jarsDir.") }
+ .toAbsolutePath
+ .toString
+ }
+
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)
+ .set(ENGINE_JDBC_EXTRA_CLASSPATH, mysqlJdbcConnectorPath)
}
override def beforeAll(): Unit = {