Skip to content

Commit

Permalink
Add tests for MySQL Percona (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
A248 committed Sep 4, 2023
1 parent fb14929 commit 58b0212
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
50 changes: 40 additions & 10 deletions bans-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@
<libertybans.it.mariadb.retro.port>${it.mariadb.retro.port}</libertybans.it.mariadb.retro.port>
<libertybans.it.mariadb.legacy.port>${it.mariadb.legacy.port}</libertybans.it.mariadb.legacy.port>
<libertybans.it.mariadb.modern.port>${it.mariadb.modern.port}</libertybans.it.mariadb.modern.port>
<libertybans.it.mysql.port>${it.mysql.port}</libertybans.it.mysql.port>
<libertybans.it.mysql.oracle.port>${it.mysql.oracle.port}</libertybans.it.mysql.oracle.port>
<libertybans.it.mysql.percona.port>${it.mysql.percona.port}</libertybans.it.mysql.percona.port>
<libertybans.it.postgres.legacy.port>${it.postgres.legacy.port}</libertybans.it.postgres.legacy.port>
<libertybans.it.postgres.modern.port>${it.postgres.modern.port}</libertybans.it.postgres.modern.port>
<libertybans.it.cockroachdb.port>${it.cockroachdb.port}</libertybans.it.cockroachdb.port>
Expand Down Expand Up @@ -380,7 +381,7 @@
<alias>mariadb-retro</alias>
<run>
<env>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>true</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>yes</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
</env>
<ports>
<port>127.0.0.1:${it.mariadb.retro.port}:3306</port>
Expand All @@ -401,7 +402,7 @@
<alias>mariadb-legacy</alias>
<run>
<env>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>true</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>yes</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
</env>
<ports>
<port>127.0.0.1:${it.mariadb.legacy.port}:3306</port>
Expand All @@ -422,7 +423,7 @@
<alias>mariadb-modern</alias>
<run>
<env>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>true</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
<MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>yes</MARIADB_ALLOW_EMPTY_ROOT_PASSWORD>
</env>
<ports>
<port>127.0.0.1:${it.mariadb.modern.port}:3306</port>
Expand Down Expand Up @@ -484,7 +485,8 @@
<id>find-available-ports</id>
<configuration>
<portNames combine.children="append">
<portName>it.mysql.port</portName>
<portName>it.mysql.oracle.port</portName>
<portName>it.mysql.percona.port</portName>
</portNames>
</configuration>
</execution>
Expand All @@ -497,29 +499,57 @@
<images combine.children="append">
<image>
<name>mysql:8.0</name>
<alias>mysql</alias>
<alias>mysql-oracle</alias>
<run>
<env>
<MYSQL_ALLOW_EMPTY_PASSWORD>true</MYSQL_ALLOW_EMPTY_PASSWORD>
<MYSQL_ALLOW_EMPTY_PASSWORD>yes</MYSQL_ALLOW_EMPTY_PASSWORD>
</env>
<ports>
<port>127.0.0.1:${it.mysql.port}:3306</port>
<port>127.0.0.1:${it.mysql.oracle.port}:3306</port>
</ports>
<wait>
<time>60000</time>
<log>/usr/sbin/mysqld: ready for connections. Version: '8.0</log>
</wait>
<volumes>
<bind>
<volume>libertybans-build-mysql:/var/lib/mysql</volume>
<volume>libertybans-build-mysql-oracle:/var/lib/mysql</volume>
</bind>
</volumes>
</run>
</image>
<image>
<name>percona:8.0</name>
<alias>mysql-percona</alias>
<run>
<env>
<MYSQL_ALLOW_EMPTY_PASSWORD>yes</MYSQL_ALLOW_EMPTY_PASSWORD>
</env>
<ports>
<port>127.0.0.1:${it.mysql.percona.port}:3306</port>
</ports>
<wait>
<time>60000</time>
<log>/usr/sbin/mysqld: ready for connections. Version: '8.0</log>
</wait>
<volumes>
<bind>
<volume>libertybans-build-mysql-percona:/var/lib/mysql</volume>
</bind>
</volumes>
</run>
</image>
</images>
<volumes combine.children="append">
<volume>
<name>libertybans-build-mysql</name>
<name>libertybans-build-mysql-oracle</name>
<opts>
<type>tmpfs</type>
<device>tmpfs</device>
</opts>
</volume>
<volume>
<name>libertybans-build-mysql-percona</name>
<opts>
<type>tmpfs</type>
<device>tmpfs</device>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public enum DatabaseInstance {
MARIADB_RETRO(Vendor.MARIADB, "libertybans.it.mariadb.retro.port"),
MARIADB_LEGACY(Vendor.MARIADB, "libertybans.it.mariadb.legacy.port"),
MARIADB_MODERN(Vendor.MARIADB, "libertybans.it.mariadb.modern.port"),
MYSQL(Vendor.MYSQL, "libertybans.it.mysql.port"),
MYSQL_ORACLE(Vendor.MYSQL, "libertybans.it.mysql.oracle.port"),
MYSQL_PERCONA(Vendor.MYSQL, "libertybans.it.mysql.percona.port"),
POSTGRES_LEGACY(Vendor.POSTGRES, "libertybans.it.postgres.legacy.port"),
POSTGRES_MODERN(Vendor.POSTGRES, "libertybans.it.postgres.modern.port"),
COCKROACHDB(Vendor.COCKROACH, "libertybans.it.cockroachdb.port"),
Expand Down Expand Up @@ -93,7 +94,7 @@ Optional<DatabaseInfo> createInfo() {

private void createDatabase(String database) {
switch (this) {
case MARIADB_RETRO, MARIADB_LEGACY, MARIADB_MODERN, MYSQL -> {
case MARIADB_RETRO, MARIADB_LEGACY, MARIADB_MODERN, MYSQL_ORACLE, MYSQL_PERCONA -> {
createDatabaseUsing("jdbc:mariadb", database, " CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
}
case POSTGRES_LEGACY, POSTGRES_MODERN, COCKROACHDB -> {
Expand Down

0 comments on commit 58b0212

Please sign in to comment.