Verify the functional correctness of pipeline scenarios.
Currently, NATIVE and DOCKER are available.
Supported databases: MySQL, PostgreSQL and openGauss.
Module path: test/e2e/operation/pipeline
.
${DOCKER-IMAGE}
refers to the name of a docker mirror, such as mysql:5.7
. ${DATABASE-TYPE}
refers to database types.
Directory: src/test/resources/env/
it-env.properties
: Environment setup configuration file.${DATABASE-TYPE}/global.yaml
: ShardingSphere-Proxy configuration fi;e.${DATABASE-TYPE}/initdb.sql
: Database initialization SQL file.${DATABASE-TYPE}/*.cnf,*.conf
: Database configuration files.common/*.xml
: DistSQL files.scenario/
: SQL files for different scenarios.Test case example: MySQLMigrationGeneralE2EIT. Functions included:
Any property of it-env.properties
could be defined by Maven command line parameter -D
, and its priority is higher than configuration file.
org.apache.shardingsphere.proxy.Bootstrap
in IDE after modifying proxy/bootstrap/src/main/resources/conf/global.yaml
.Refer to following files for proxy global.yaml
configuration:
Start registry center (e.g. ZooKeeper) and database.
Take MySQL as an example, it-env.properties
could be configured as follows:
pipeline.it.env.type=NATIVE
pipeline.it.native.database=mysql
pipeline.it.native.mysql.username=root
pipeline.it.native.mysql.password=root
pipeline.it.native.mysql.port=3306
Refer to .github/workflows/e2e-pipeline.yml
for more details.
./mvnw -B clean install -am -pl test/e2e/operation/pipeline -Pit.env.docker -DskipTests
Running the above command will build a docker image apache/shardingsphere-proxy-test:latest
.
The docker image has port 3308
for remote debugging.
If only test code is modified, you could reuse existing docker image.
it-env.properties
.pipeline.it.env.type=DOCKER
pipeline.it.docker.mysql.version=mysql:5.7
Take MySQL as an example:
./mvnw -nsu -B install -f test/e2e/operation/pipeline/pom.xml -Dpipeline.it.env.type=docker -Dpipeline.it.docker.mysql.version=mysql:5.7