264 lines
12 KiB
XML
264 lines
12 KiB
XML
<?xml version="1.0"?>
|
|
<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>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-mysql-integration-tests</artifactId>
|
|
<version>0.4.0-SNAPSHOT</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<artifactId>debezium-connector-mysql-5.7-gtid-integration-tests</artifactId>
|
|
<packaging>jar</packaging>
|
|
<name>Test MySQL 5.7 with GTIDs</name>
|
|
<description>Test MySQL 5.7 with GTIDs</description>
|
|
|
|
<dependencies>
|
|
<!-- Define the dependencies that all MySQL integration tests will need -->
|
|
<dependency>
|
|
<groupId>mysql</groupId>
|
|
<artifactId>mysql-connector-java</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<properties>
|
|
<!--
|
|
The expected results have GTID ranges for this specific patch release. Other patch releases may
|
|
slightly change the order of the operations and transactions, so the expected results may
|
|
have to be regenerated when a different patch release is used.
|
|
-->
|
|
<version.mysql.server>5.7.17</version.mysql.server>
|
|
<docker.skip>false</docker.skip>
|
|
<!--
|
|
Specify the properties that will be used for setting up the integration tests' Docker container.
|
|
We'll set some of these as system properties so they are accessible by the integration tests.
|
|
-->
|
|
<database.port>3306</database.port>
|
|
<database.user>mysqluser</database.user>
|
|
<database.password>mysqlpw</database.password>
|
|
<database.replica.port>4306</database.replica.port>
|
|
<database.replica.user>mysqlreplica</database.replica.user>
|
|
<database.replica.password>mysqlpw</database.replica.password>
|
|
</properties>
|
|
|
|
<build>
|
|
<plugins>
|
|
<!-- Do not deploy this during a release -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-deploy-plugin</artifactId>
|
|
<configuration>
|
|
<skip>true</skip>
|
|
</configuration>
|
|
</plugin>
|
|
<!-- Do not build a non-test JAR -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-jar</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>io.fabric8</groupId>
|
|
<artifactId>docker-maven-plugin</artifactId>
|
|
<configuration>
|
|
<watchInterval>500</watchInterval>
|
|
<logDate>default</logDate>
|
|
<verbose>true</verbose>
|
|
<autoPull>always</autoPull>
|
|
<images>
|
|
<!--
|
|
Images based on "mysql/mysql-server" Docker image
|
|
-->
|
|
<image>
|
|
<!-- A Docker image using a partial MySQL installation maintained by MySQL team. -->
|
|
<name>debezium/mysql-server-${version.mysql.server}-gtids-test-database</name>
|
|
<alias>database</alias>
|
|
<run>
|
|
<namingStrategy>alias</namingStrategy>
|
|
<env>
|
|
<MYSQL_ROOT_PASSWORD>debezium-rocks</MYSQL_ROOT_PASSWORD>
|
|
<MYSQL_DATABASE>mysql</MYSQL_DATABASE> <!-- database created upon init -->
|
|
<MYSQL_USER>${database.user}</MYSQL_USER>
|
|
<MYSQL_PASSWORD>${database.password}</MYSQL_PASSWORD>
|
|
</env>
|
|
<ports>
|
|
<port>${database.port}:3306</port>
|
|
</ports>
|
|
<log>
|
|
<prefix>mysql-gtids</prefix>
|
|
<enabled>true</enabled>
|
|
<color>cyan</color>
|
|
</log>
|
|
<wait>
|
|
<log>MySQL init process done. Ready for start up.</log>
|
|
<time>30000</time>
|
|
</wait>
|
|
</run>
|
|
<build>
|
|
<from>mysql/mysql-server:${version.mysql.server}</from>
|
|
<assembly>
|
|
<inline>
|
|
<fileSets>
|
|
<fileSet>
|
|
<directory>${project.basedir}/src/test/docker/server</directory>
|
|
<includes>
|
|
<include>my.cnf</include>
|
|
</includes>
|
|
<outputDirectory>etc/mysql</outputDirectory>
|
|
</fileSet>
|
|
<fileSet>
|
|
<directory>${project.basedir}/src/test/docker/init</directory>
|
|
<outputDirectory>docker-entrypoint-initdb.d</outputDirectory>
|
|
</fileSet>
|
|
</fileSets>
|
|
</inline>
|
|
<targetDir>/</targetDir>
|
|
</assembly>
|
|
</build>
|
|
</image>
|
|
<image>
|
|
<!--
|
|
A Docker image using a MySQL installation maintained by MySQL team
|
|
that is a replica of `debezium/mysql-server-gtids-test-database`
|
|
-->
|
|
<name>debezium/mysql-server-${version.mysql.server}-gtids-test-database-replica</name>
|
|
<alias>database-replica</alias>
|
|
<run>
|
|
<namingStrategy>alias</namingStrategy>
|
|
<env>
|
|
<MYSQL_ROOT_PASSWORD>debezium-rocks</MYSQL_ROOT_PASSWORD>
|
|
<MYSQL_USER>${database.replica.user}</MYSQL_USER>
|
|
<MYSQL_PASSWORD>${database.replica.password}</MYSQL_PASSWORD>
|
|
</env>
|
|
<links>
|
|
<link>database</link>
|
|
</links>
|
|
<ports>
|
|
<port>${database.replica.port}:3306</port>
|
|
</ports>
|
|
<log>
|
|
<prefix>mysql-replica</prefix>
|
|
<enabled>true</enabled>
|
|
<color>yellow</color>
|
|
</log>
|
|
<wait>
|
|
<log>MySQL init process done. Ready for start up.</log>
|
|
<time>30000</time> <!-- 30 seconds max -->
|
|
</wait>
|
|
</run>
|
|
<build>
|
|
<from>mysql/mysql-server:${version.mysql.server}</from>
|
|
<assembly>
|
|
<inline>
|
|
<fileSets>
|
|
<fileSet>
|
|
<directory>${project.basedir}/src/test/docker/server-replica</directory>
|
|
<includes>
|
|
<include>my.cnf</include>
|
|
</includes>
|
|
<outputDirectory>etc/mysql</outputDirectory>
|
|
</fileSet>
|
|
<fileSet>
|
|
<directory>${project.basedir}/src/test/docker/init-replica</directory>
|
|
<outputDirectory>docker-entrypoint-initdb.d</outputDirectory>
|
|
</fileSet>
|
|
</fileSets>
|
|
</inline>
|
|
<basedir>/</basedir>
|
|
</assembly>
|
|
</build>
|
|
</image>
|
|
</images>
|
|
</configuration>
|
|
<!--
|
|
Connect this plugin to the maven lifecycle around the integration-test phase:
|
|
start the container in pre-integration-test and stop it in post-integration-test.
|
|
-->
|
|
<executions>
|
|
<execution>
|
|
<id>start</id>
|
|
<phase>pre-integration-test</phase>
|
|
<goals>
|
|
<goal>build</goal>
|
|
<goal>start</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>stop</id>
|
|
<phase>post-integration-test</phase>
|
|
<goals>
|
|
<goal>stop</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!--
|
|
Unlike surefire, the failsafe plugin ensures 'post-integration-test' phase always runs, even
|
|
when there are failed integration tests. We rely upon this to always shut down the Docker container
|
|
after the integration tests (defined as '*IT.java') are run.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-failsafe-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>integration-test</id>
|
|
<goals>
|
|
<goal>integration-test</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>verify</id>
|
|
<goals>
|
|
<goal>verify</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<skipTests>${skipITs}</skipTests>
|
|
<enableAssertions>true</enableAssertions>
|
|
<systemPropertyVariables>
|
|
<!-- Make these available to the tests via system properties -->
|
|
<database.hostname>${docker.host.address}</database.hostname>
|
|
<database.port>${database.port}</database.port>
|
|
<database.user>${database.user}</database.user>
|
|
<database.password>${database.password}</database.password>
|
|
<database.replica.port>${database.replica.port}</database.replica.port>
|
|
<database.replica.user>${database.replica.user}</database.replica.user>
|
|
<database.replica.password>${database.replica.password}</database.replica.password>
|
|
<skipLongRunningTests>${skipLongRunningTests}</skipLongRunningTests>
|
|
</systemPropertyVariables>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
<resources>
|
|
<!-- Apply the properties set in the POM to the resource files -->
|
|
<resource>
|
|
<filtering>true</filtering>
|
|
<directory>src/main/resources</directory>
|
|
<includes>
|
|
<include>*</include>
|
|
<include>**/*</include>
|
|
</includes>
|
|
</resource>
|
|
</resources>
|
|
<testResources>
|
|
<testResource>
|
|
<directory>src/test/resources</directory>
|
|
<filtering>true</filtering>
|
|
<includes>
|
|
<include>*</include>
|
|
<include>**/*</include>
|
|
</includes>
|
|
</testResource>
|
|
</testResources>
|
|
</build>
|
|
|
|
</project>
|