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
This commit is contained in:
Tejaswini Bandlamudi 2023-02-15 11:03:25 +05:30 committed by GitHub
parent f67abf2e99
commit 9ffaba9c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 1 deletions

View File

@ -37,8 +37,14 @@ on:
description: 'IT test Category' description: 'IT test Category'
required: true required: true
type: string type: string
mysql_driver:
description: 'MySQL driver to use'
required: false
type: string
default: com.mysql.jdbc.Driver
env: env:
MYSQL_DRIVER_CLASSNAME: ${{ inputs.mysql_driver }} # Used by tests to connect to metadata store directly.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
jobs: jobs:

View File

@ -34,3 +34,4 @@ jobs:
use_indexer: ${{ matrix.indexer }} use_indexer: ${{ matrix.indexer }}
script: ./it.sh github ${{ matrix.it }} script: ./it.sh github ${{ matrix.it }}
it: ${{ matrix.it }} it: ${{ matrix.it }}
mysql_driver: com.mysql.jdbc.Driver

View File

@ -29,6 +29,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
MYSQL_DRIVER_CLASSNAME: com.mysql.jdbc.Driver # Used to set druid config in docker image for revised ITs
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
jobs: jobs:

View File

@ -202,12 +202,19 @@
<version>${com.google.apis.client.version}</version> <version>${com.google.apis.client.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Tests can choose either the MySQL or MariaDB driver. -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version> <version>${mysql.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb.version}</version>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.jdbi</groupId> <groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId> <artifactId>jdbi</artifactId>

View File

@ -275,6 +275,7 @@ public class Initializer
property("druid.client.https.certAlias", "druid"); property("druid.client.https.certAlias", "druid");
property("druid.client.https.keyManagerPassword", "druid123"); property("druid.client.https.keyManagerPassword", "druid123");
property("druid.client.https.keyStorePassword", "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 // More env var bindings for properties formerly passed in via
// a generated config file. // a generated config file.

View File

@ -41,6 +41,9 @@ cd /
# Test-specific way to define extensions. Compose defines two test-specific # Test-specific way to define extensions. Compose defines two test-specific
# variables. We combine these to create the final form converted to a property. # 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 if [ -n "$druid_extensions_loadList" ]; then
echo "Using the provided druid_extensions_loadList=$druid_extensions_loadList" echo "Using the provided druid_extensions_loadList=$druid_extensions_loadList"
else else

View File

@ -202,7 +202,6 @@ Reference: https://dzone.com/articles/build-docker-image-from-maven
<environmentVariables> <environmentVariables>
<MYSQL_VERSION>${mysql.version}</MYSQL_VERSION> <MYSQL_VERSION>${mysql.version}</MYSQL_VERSION>
<MARIADB_VERSION>${mariadb.version}</MARIADB_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> <MYSQL_IMAGE_VERSION>${mysql.image.version}</MYSQL_IMAGE_VERSION>
<CONFLUENT_VERSION>${confluent-version}</CONFLUENT_VERSION> <CONFLUENT_VERSION>${confluent-version}</CONFLUENT_VERSION>
<KAFKA_VERSION>${apache.kafka.version}</KAFKA_VERSION> <KAFKA_VERSION>${apache.kafka.version}</KAFKA_VERSION>