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

abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ffaba9c7f Fix MySQL drivers setup for Revised ITs (#13800)
9ffaba9c7f is described below

commit 9ffaba9c7fc72495e1b65ffad67270af230bf6c0
Author: Tejaswini Bandlamudi <[email protected]>
AuthorDate: Wed Feb 15 11:03:25 2023 +0530

    Fix MySQL drivers setup for Revised ITs (#13800)
    
    * download both mysql drivers and use org.mariadb.jdbc.Driver for now
    
    * use com.mysql.jdbc.Driver
---
 .github/workflows/reusable-revised-its.yml                         | 6 ++++++
 .github/workflows/revised-its.yml                                  | 1 +
 .github/workflows/unit-and-integration-tests-unified.yml           | 1 +
 integration-tests-ex/cases/pom.xml                                 | 7 +++++++
 .../src/test/java/org/apache/druid/testsEx/config/Initializer.java | 1 +
 integration-tests-ex/image/docker/launch.sh                        | 3 +++
 integration-tests-ex/image/pom.xml                                 | 1 -
 7 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/reusable-revised-its.yml 
b/.github/workflows/reusable-revised-its.yml
index 26c045fb86..326ce85719 100644
--- a/.github/workflows/reusable-revised-its.yml
+++ b/.github/workflows/reusable-revised-its.yml
@@ -37,8 +37,14 @@ on:
         description: 'IT test Category'
         required: true
         type: string
+      mysql_driver:
+        description: 'MySQL driver to use'
+        required: false
+        type: string
+        default: com.mysql.jdbc.Driver
 
 env:
+  MYSQL_DRIVER_CLASSNAME: ${{ inputs.mysql_driver }} # Used by tests to 
connect to metadata store directly.
   SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
 
 jobs:
diff --git a/.github/workflows/revised-its.yml 
b/.github/workflows/revised-its.yml
index f581d4c727..afed291d79 100644
--- a/.github/workflows/revised-its.yml
+++ b/.github/workflows/revised-its.yml
@@ -34,3 +34,4 @@ jobs:
       use_indexer: ${{ matrix.indexer }}
       script: ./it.sh github ${{ matrix.it }}
       it: ${{ matrix.it }}
+      mysql_driver: com.mysql.jdbc.Driver
diff --git a/.github/workflows/unit-and-integration-tests-unified.yml 
b/.github/workflows/unit-and-integration-tests-unified.yml
index 5d79f5ef03..f4cada6d4e 100644
--- a/.github/workflows/unit-and-integration-tests-unified.yml
+++ b/.github/workflows/unit-and-integration-tests-unified.yml
@@ -29,6 +29,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
+  MYSQL_DRIVER_CLASSNAME: com.mysql.jdbc.Driver # Used to set druid config in 
docker image for revised ITs
   SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
 
 jobs:
diff --git a/integration-tests-ex/cases/pom.xml 
b/integration-tests-ex/cases/pom.xml
index 9a255188a6..4c8571f2ac 100644
--- a/integration-tests-ex/cases/pom.xml
+++ b/integration-tests-ex/cases/pom.xml
@@ -202,12 +202,19 @@
             <version>${com.google.apis.client.version}</version>
             <scope>provided</scope>
         </dependency>
+        <!-- Tests can choose either the MySQL or MariaDB driver. -->
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
             <version>${mysql.version}</version>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>org.mariadb.jdbc</groupId>
+            <artifactId>mariadb-java-client</artifactId>
+            <version>${mariadb.version}</version>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>org.jdbi</groupId>
             <artifactId>jdbi</artifactId>
diff --git 
a/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/config/Initializer.java
 
b/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/config/Initializer.java
index ebd4e003ce..80d1dec0e6 100644
--- 
a/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/config/Initializer.java
+++ 
b/integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/config/Initializer.java
@@ -275,6 +275,7 @@ public class Initializer
       property("druid.client.https.certAlias", "druid");
       property("druid.client.https.keyManagerPassword", "druid123");
       property("druid.client.https.keyStorePassword", "druid123");
+      propertyEnvVarBinding("druid.metadata.mysql.driver.driverClassName", 
"MYSQL_DRIVER_CLASSNAME");
 
       // More env var bindings for properties formerly passed in via
       // a generated config file.
diff --git a/integration-tests-ex/image/docker/launch.sh 
b/integration-tests-ex/image/docker/launch.sh
index 1f64b4e14d..8116ab9632 100644
--- a/integration-tests-ex/image/docker/launch.sh
+++ b/integration-tests-ex/image/docker/launch.sh
@@ -41,6 +41,9 @@ cd /
 
 # Test-specific way to define extensions. Compose defines two test-specific
 # variables. We combine these to create the final form converted to a property.
+if [ -n "$MYSQL_DRIVER_CLASSNAME" ]; then
+  export druid_metadata_mysql_driver_driverClassName="$MYSQL_DRIVER_CLASSNAME"
+fi
 if [ -n "$druid_extensions_loadList" ]; then
        echo "Using the provided 
druid_extensions_loadList=$druid_extensions_loadList"
 else
diff --git a/integration-tests-ex/image/pom.xml 
b/integration-tests-ex/image/pom.xml
index 2fbeba3935..be6f8970a8 100644
--- a/integration-tests-ex/image/pom.xml
+++ b/integration-tests-ex/image/pom.xml
@@ -202,7 +202,6 @@ Reference: 
https://dzone.com/articles/build-docker-image-from-maven
                                     <environmentVariables>
                                         
<MYSQL_VERSION>${mysql.version}</MYSQL_VERSION>
                                         
<MARIADB_VERSION>${mariadb.version}</MARIADB_VERSION>
-                                        
<MYSQL_DRIVER_CLASSNAME>com.mysql.jdbc.Driver</MYSQL_DRIVER_CLASSNAME>
                                         
<MYSQL_IMAGE_VERSION>${mysql.image.version}</MYSQL_IMAGE_VERSION>
                                         
<CONFLUENT_VERSION>${confluent-version}</CONFLUENT_VERSION>
                                         
<KAFKA_VERSION>${apache.kafka.version}</KAFKA_VERSION>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to