HHH-15533 Introduce versionless CI matrix entries for the PostgreSQL and MySQL minimum supported version

This commit is contained in:
Christian Beikov 2022-09-20 09:26:06 +02:00
parent 5ad3abc628
commit bfd1f22157
7 changed files with 51 additions and 31 deletions

View File

@ -38,9 +38,10 @@ jobs:
- rdbms: h2 - rdbms: h2
- rdbms: hsqldb - rdbms: hsqldb
- rdbms: derby - rdbms: derby
- rdbms: mysql
- rdbms: mysql8 - rdbms: mysql8
- rdbms: mariadb - rdbms: mariadb
- rdbms: postgresql_9_5 - rdbms: postgresql
- rdbms: postgresql_13 - rdbms: postgresql_13
- rdbms: oracle - rdbms: oracle
- rdbms: db2 - rdbms: db2

17
Jenkinsfile vendored
View File

@ -30,9 +30,10 @@ stage('Configure') {
// new BuildEnvironment( dbName: 'h2' ), // new BuildEnvironment( dbName: 'h2' ),
// new BuildEnvironment( dbName: 'hsqldb' ), // new BuildEnvironment( dbName: 'hsqldb' ),
// new BuildEnvironment( dbName: 'derby' ), // new BuildEnvironment( dbName: 'derby' ),
// new BuildEnvironment( dbName: 'mysql' ),
// new BuildEnvironment( dbName: 'mysql8' ), // new BuildEnvironment( dbName: 'mysql8' ),
// new BuildEnvironment( dbName: 'mariadb' ), // new BuildEnvironment( dbName: 'mariadb' ),
// new BuildEnvironment( dbName: 'postgresql_9_5' ), // new BuildEnvironment( dbName: 'postgresql' ),
// new BuildEnvironment( dbName: 'postgresql_13' ), // new BuildEnvironment( dbName: 'postgresql_13' ),
// new BuildEnvironment( dbName: 'oracle' ), // new BuildEnvironment( dbName: 'oracle' ),
new BuildEnvironment( dbName: 'oracle_ee' ), new BuildEnvironment( dbName: 'oracle_ee' ),
@ -116,6 +117,13 @@ stage('Build') {
try { try {
stage('Start database') { stage('Start database') {
switch (buildEnv.dbName) { switch (buildEnv.dbName) {
case "mysql":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('mysql:5.7').pull()
}
sh "./docker_db.sh mysql"
state[buildEnv.tag]['containerName'] = "mysql"
break;
case "mysql8": case "mysql8":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('mysql:8.0.21').pull() docker.image('mysql:8.0.21').pull()
@ -130,12 +138,12 @@ stage('Build') {
sh "./docker_db.sh mariadb" sh "./docker_db.sh mariadb"
state[buildEnv.tag]['containerName'] = "mariadb" state[buildEnv.tag]['containerName'] = "mariadb"
break; break;
case "postgresql_9_5": case "postgresql":
// use the postgis image to enable the PGSQL GIS (spatial) extension // use the postgis image to enable the PGSQL GIS (spatial) extension
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('postgis/postgis:9.5-2.5').pull() docker.image('postgis/postgis:9.5-2.5').pull()
} }
sh "./docker_db.sh postgresql_9_5" sh "./docker_db.sh postgresql"
state[buildEnv.tag]['containerName'] = "postgres" state[buildEnv.tag]['containerName'] = "postgres"
break; break;
case "postgresql_13": case "postgresql_13":
@ -191,13 +199,14 @@ stage('Build') {
case "hsqldb": case "hsqldb":
runTest("-Pdb=${buildEnv.dbName}${state[buildEnv.tag]['additionalOptions']}") runTest("-Pdb=${buildEnv.dbName}${state[buildEnv.tag]['additionalOptions']}")
break; break;
case "mysql":
case "mysql8": case "mysql8":
runTest("-Pdb=mysql_ci${state[buildEnv.tag]['additionalOptions']}") runTest("-Pdb=mysql_ci${state[buildEnv.tag]['additionalOptions']}")
break; break;
case "tidb": case "tidb":
runTest("-Pdb=tidb -DdbHost=localhost:4000${state[buildEnv.tag]['additionalOptions']}", 'TIDB') runTest("-Pdb=tidb -DdbHost=localhost:4000${state[buildEnv.tag]['additionalOptions']}", 'TIDB')
break; break;
case "postgresql_9_5": case "postgresql":
case "postgresql_13": case "postgresql_13":
runTest("-Pdb=pgsql_ci${state[buildEnv.tag]['additionalOptions']}") runTest("-Pdb=pgsql_ci${state[buildEnv.tag]['additionalOptions']}")
break; break;

View File

@ -130,7 +130,7 @@ The script `docker_db.sh` allows you to start a pre-configured database which ca
All you have to do is run the following command: All you have to do is run the following command:
---- ----
./docker_db.sh postgresql_9_5 ./docker_db.sh postgresql
---- ----
omitting the argument will print a list of possible options. omitting the argument will print a list of possible options.
@ -162,7 +162,7 @@ The following table illustrates a list of commands for various databases that ca
|`./gradlew test -Pdb=derby` |`./gradlew test -Pdb=derby`
|MySQL 5.7 |MySQL 5.7
|`./docker_db.sh mysql_5_7` |`./docker_db.sh mysql`
|`./gradlew test -Pdb=mysql_ci` |`./gradlew test -Pdb=mysql_ci`
|MySQL 8.0 |MySQL 8.0
@ -174,7 +174,7 @@ The following table illustrates a list of commands for various databases that ca
|`./gradlew test -Pdb=mariadb_ci` |`./gradlew test -Pdb=mariadb_ci`
|PostgreSQL 9.5 |PostgreSQL 9.5
|`./docker_db.sh postgresql_9_5` |`./docker_db.sh postgresql`
|`./gradlew test -Pdb=pgsql_ci` |`./gradlew test -Pdb=pgsql_ci`
|PostgreSQL 13 |PostgreSQL 13

View File

@ -11,7 +11,7 @@ elif [ "$RDBMS" == "mysql" ]; then
goal="-Pdb=mysql_ci" goal="-Pdb=mysql_ci"
elif [ "$RDBMS" == "mariadb" ]; then elif [ "$RDBMS" == "mariadb" ]; then
goal="-Pdb=mariadb_ci" goal="-Pdb=mariadb_ci"
elif [ "$RDBMS" == "postgresql_9_5" ]; then elif [ "$RDBMS" == "postgresql" ]; then
goal="-Pdb=pgsql_ci" goal="-Pdb=pgsql_ci"
elif [ "$RDBMS" == "postgresql_13" ]; then elif [ "$RDBMS" == "postgresql_13" ]; then
goal="-Pdb=pgsql_ci" goal="-Pdb=pgsql_ci"

View File

@ -3,13 +3,13 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "$RDBMS" == 'mysql' ]; then if [ "$RDBMS" == 'mysql' ]; then
bash $DIR/../docker_db.sh mysql_5_7 bash $DIR/../docker_db.sh mysql
elif [ "$RDBMS" == 'mysql8' ]; then elif [ "$RDBMS" == 'mysql8' ]; then
bash $DIR/../docker_db.sh mysql_8_0 bash $DIR/../docker_db.sh mysql_8_0
elif [ "$RDBMS" == 'mariadb' ]; then elif [ "$RDBMS" == 'mariadb' ]; then
bash $DIR/../docker_db.sh mariadb bash $DIR/../docker_db.sh mariadb
elif [ "$RDBMS" == 'postgresql_9_5' ]; then elif [ "$RDBMS" == 'postgresql' ]; then
bash $DIR/../docker_db.sh postgresql_9_5 bash $DIR/../docker_db.sh postgresql
elif [ "$RDBMS" == 'postgresql_13' ]; then elif [ "$RDBMS" == 'postgresql_13' ]; then
bash $DIR/../docker_db.sh postgresql_13 bash $DIR/../docker_db.sh postgresql_13
elif [ "$RDBMS" == 'db2' ]; then elif [ "$RDBMS" == 'db2' ]; then

View File

@ -15,6 +15,10 @@ else
PRIVILEGED_CLI="" PRIVILEGED_CLI=""
fi fi
mysql() {
mysql_5_7
}
mysql_5_7() { mysql_5_7() {
$CONTAINER_CLI rm -f mysql || true $CONTAINER_CLI rm -f mysql || true
$CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake --log-bin-trust-function-creators=1 $CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake --log-bin-trust-function-creators=1
@ -86,6 +90,10 @@ mariadb() {
fi fi
} }
postgresql() {
postgresql_9_5
}
postgresql_9_5() { postgresql_9_5() {
$CONTAINER_CLI rm -f postgres || true $CONTAINER_CLI rm -f postgres || true
$CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d docker.io/postgis/postgis:9.5-2.5 $CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d docker.io/postgis/postgis:9.5-2.5
@ -517,6 +525,7 @@ if [ -z ${1} ]; then
echo -e "\thana" echo -e "\thana"
echo -e "\tmariadb" echo -e "\tmariadb"
echo -e "\tmssql" echo -e "\tmssql"
echo -e "\tmysql"
echo -e "\tmysql_5_7" echo -e "\tmysql_5_7"
echo -e "\tmysql_8_0" echo -e "\tmysql_8_0"
echo -e "\toracle" echo -e "\toracle"
@ -527,6 +536,7 @@ if [ -z ${1} ]; then
echo -e "\tpostgis" echo -e "\tpostgis"
echo -e "\tpostgresql_13" echo -e "\tpostgresql_13"
echo -e "\tpostgresql_9_5" echo -e "\tpostgresql_9_5"
echo -e "\tpostgresql"
echo -e "\tsybase" echo -e "\tsybase"
else else
${1} ${1}

View File

@ -16,48 +16,48 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>1</id> <id>1</id>
<type>POINT</type> <type>POINT</type>
<wkt>SRID=4326;POINT(10 5)</wkt> <wkt>SRID=0;POINT(10 5)</wkt>
</Element> </Element>
<Element> <Element>
<id>2</id> <id>2</id>
<type>POINT</type> <type>POINT</type>
<wkt>SRID=4326;POINT(52.25 2.53)</wkt> <wkt>SRID=0;POINT(52.25 2.53)</wkt>
</Element> </Element>
<Element> <Element>
<id>3</id> <id>3</id>
<type>POINT</type> <type>POINT</type>
<wkt>SRID=4326;POINT(51 12)</wkt> <wkt>SRID=0;POINT(51 12)</wkt>
</Element> </Element>
<Element> <Element>
<id>4</id> <id>4</id>
<type>POINT</type> <type>POINT</type>
<wkt>SRID=4326;POINT(10.0 2.0)</wkt> <wkt>SRID=0;POINT(10.0 2.0)</wkt>
</Element> </Element>
<Element> <Element>
<id>5</id> <id>5</id>
<type>LINESTRING</type> <type>LINESTRING</type>
<wkt>SRID=4326;LINESTRING(10.0 5.0, 20.0 15.0)</wkt> <wkt>SRID=0;LINESTRING(10.0 5.0, 20.0 15.0)</wkt>
</Element> </Element>
<Element> <Element>
<id>6</id> <id>6</id>
<type>LINESTRING</type> <type>LINESTRING</type>
<wkt>SRID=4326;LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0)</wkt> <wkt>SRID=0;LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0)</wkt>
</Element> </Element>
<Element> <Element>
<id>11</id> <id>11</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))</wkt> <wkt>SRID=0;MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))</wkt>
</Element> </Element>
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40 <wkt>SRID=0;MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40
14.0)) 14.0))
</wkt> </wkt>
</Element> </Element>
@ -66,28 +66,28 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>16</id> <id>16</id>
<type>POLYGON</type> <type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) )</wkt> <wkt>SRID=0;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) )</wkt>
</Element> </Element>
<Element> <Element>
<id>18</id> <id>18</id>
<type>POLYGON</type> <type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 5, 5 5,5 2, 2 2))</wkt> <wkt>SRID=0;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 5, 5 5,5 2, 2 2))</wkt>
</Element> </Element>
<Element> <Element>
<id>19</id> <id>19</id>
<type>POLYGON</type> <type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (110 110, 110 120, 120 120, 120 110, 110 110) )</wkt> <wkt>SRID=0;POLYGON( (110 110, 110 120, 120 120, 120 110, 110 110) )</wkt>
</Element> </Element>
<Element> <Element>
<id>20</id> <id>20</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, 120 140, 130 134, 105 100)) )</wkt> <wkt>SRID=0;MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, 120 140, 130 134, 105 100)) )</wkt>
</Element> </Element>
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((105 100, <wkt>SRID=0;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((105 100,
120 140, 130 120 140, 130
134, 105 100)) ) 134, 105 100)) )
</wkt> </wkt>
@ -97,28 +97,28 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>25</id> <id>25</id>
<type>MULTIPOINT</type> <type>MULTIPOINT</type>
<wkt>SRID=4326;MULTIPOINT(21 2, 25 5, 30 3)</wkt> <wkt>SRID=0;MULTIPOINT(21 2, 25 5, 30 3)</wkt>
</Element> </Element>
<Element> <Element>
<id>26</id> <id>26</id>
<type>MULTIPOINT</type> <type>MULTIPOINT</type>
<wkt>SRID=4326;MULTIPOINT(21 2)</wkt> <wkt>SRID=0;MULTIPOINT(21 2)</wkt>
</Element> </Element>
<Element> <Element>
<id>30</id> <id>30</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3))</wkt> <wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3))</wkt>
</Element> </Element>
<Element> <Element>
<id>31</id> <id>31</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0)))</wkt> <wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0)))</wkt>
</Element> </Element>
<Element> <Element>
<id>32</id> <id>32</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0),(1 1, 2 1, <wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0),(1 1, 2 1,
2 2, 1 2, 2 2, 1 2,
1 1))) 1 1)))
</wkt> </wkt>
@ -126,7 +126,7 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>33</id> <id>33</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), <wkt>SRID=0;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)),
((105 100, ((105 100,
120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))) 120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)))
</wkt> </wkt>