Skip certain LockTests for Oracle on GH Actions which don't work there

This commit is contained in:
Christian Beikov 2021-04-06 14:24:13 +02:00
parent 298b1f87b7
commit b166e684e1
9 changed files with 68 additions and 98 deletions

View File

@ -41,10 +41,19 @@ jobs:
experimental: true experimental: true
- rdbms: mssql - rdbms: mssql
experimental: true experimental: true
# Running with HANA requires at least 8GB memory just for the database, which we don't have on GH Actions runners
# - rdbms: hana
# experimental: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
persist-credentials: false
- name: Reclaim Disk Space - name: Reclaim Disk Space
run: .github/ci-prerequisites.sh run: .github/ci-prerequisites.sh
- name: Start database
env:
RDBMS: ${{ matrix.rdbms }}
run: ci/database-start.sh
- name: Set up Java 8 - name: Set up Java 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
@ -86,6 +95,8 @@ jobs:
continue-on-error: true continue-on-error: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Java 11 - name: Set up Java 11
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:

View File

@ -1,56 +0,0 @@
dist: trusty
language: java
script:
- ./ci/build-travis.sh
before_cache:
- ./ci/before-cache.sh
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
matrix:
fast_finish: true
include:
- env: RDBMS=h2
jdk: oraclejdk8
sudo: required
# - env: RDBMS=derby
# jdk: oraclejdk8
# sudo: required
# - env: RDBMS=mariadb
# jdk: oraclejdk8
# sudo: true
# services:
# - docker
# - env: RDBMS=postgresql
# jdk: oraclejdk8
# sudo: true
# services:
# - docker
# - env: RDBMS=oracle
# jdk: oraclejdk8
# sudo: true
# services:
# - docker
# - env: RDBMS=db2
# jdk: oraclejdk8
# sudo: true
# services:
# - docker
# - env: RDBMS=mssql
# jdk: oraclejdk8
# sudo: true
# services:
# - docker
- env: JDK=11
install:
- curl -L -o install-jdk.sh https://github.com/sormuras/bach/raw/master/install-jdk.sh
- source ./install-jdk.sh --target ./openjdk11 --url https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11.1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz
allow_failures:
# - env: RDBMS=derby
# - env: RDBMS=mariadb
# - env: RDBMS=postgresql
# - env: RDBMS=oracle
# - env: RDBMS=db2
# - env: RDBMS=mssql
- env: JDK=11

View File

@ -146,3 +146,22 @@ You can do this from the module which you are interested in testing or from the
Afterward, just pick any test from the IDE and run it as usual. Hibernate will pick the database configuration from the `hibernate.properties` Afterward, just pick any test from the IDE and run it as usual. Hibernate will pick the database configuration from the `hibernate.properties`
file that was set up by the `setDataBase` Gradle task. file that was set up by the `setDataBase` Gradle task.
Starting test databases locally as docker containers
-------------------------------------------------------------
You don't have to install all databases locally to be able to test against them in case you have docker available.
The script `docker_db.sh` allows you to start a pre-configured database which can be used for testing.
All you have to do is run the following command:
./docker_db.sh postgresql_9_5
omitting the argument will print a list of possible options.
When the database is properly started, you can run tests with special profiles that are suffixed with `_ci`
e.g. `pgsql_ci` for PostgreSQL. By using the system property `dbHost` you can configure the IP address of your docker host.
The command for running tests could look like the following:
gradlew test -Pdb=pgsql_ci "-DdbHost=192.168.99.100"

View File

@ -4,20 +4,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
java -version java -version
if [ "$RDBMS" == 'mysql' ]; then
bash $DIR/../docker_db.sh mysql_5_7
elif [ "$RDBMS" == 'mysql8' ]; then
bash $DIR/../docker_db.sh mysql_8_0
elif [ "$RDBMS" == 'mariadb' ]; then
bash $DIR/../docker_db.sh mariadb
elif [ "$RDBMS" == 'postgresql' ]; then
bash $DIR/../docker_db.sh postgresql_9_5
elif [ "$RDBMS" == 'db2' ]; then
bash $DIR/../docker_db.sh db2
elif [ "$RDBMS" == 'oracle' ]; then
bash $DIR/../docker_db.sh oracle
elif [ "$RDBMS" == 'mssql' ]; then
bash $DIR/../docker_db.sh mssql
fi
exec bash $DIR/build.sh exec bash $DIR/build.sh

View File

@ -8,11 +8,14 @@ elif [ "$RDBMS" == "mariadb" ]; then
elif [ "$RDBMS" == "postgresql" ]; then elif [ "$RDBMS" == "postgresql" ]; then
goal="-Pdb=pgsql_ci" goal="-Pdb=pgsql_ci"
elif [ "$RDBMS" == "oracle" ]; then elif [ "$RDBMS" == "oracle" ]; then
goal="-Pdb=oracle_ci" # I have no idea why, but these tests don't work on GH Actions
goal="-Pdb=oracle_ci -PexcludeTests=**.LockTest.testQueryTimeout*"
elif [ "$RDBMS" == "db2" ]; then elif [ "$RDBMS" == "db2" ]; then
goal="-Pdb=db2_ci" goal="-Pdb=db2_ci"
elif [ "$RDBMS" == "mssql" ]; then elif [ "$RDBMS" == "mssql" ]; then
goal="-Pdb=mssql_ci" goal="-Pdb=mssql_ci"
elif [ "$RDBMS" == "hana" ]; then
goal="-Pdb=hana_ci"
fi fi
exec ./gradlew check ${goal} -Plog-test-progress=true --stacktrace exec ./gradlew check ${goal} -Plog-test-progress=true --stacktrace

View File

@ -2,19 +2,13 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
java -version
if [ "$RDBMS" == 'mysql' ]; then if [ "$RDBMS" == 'mysql' ]; then
sudo service mysql stop
bash $DIR/../docker_db.sh mysql_5_7 bash $DIR/../docker_db.sh mysql_5_7
elif [ "$RDBMS" == 'mysql8' ]; then elif [ "$RDBMS" == 'mysql8' ]; then
sudo service mysql stop
bash $DIR/../docker_db.sh mysql_8_0 bash $DIR/../docker_db.sh mysql_8_0
elif [ "$RDBMS" == 'mariadb' ]; then elif [ "$RDBMS" == 'mariadb' ]; then
sudo service mysql stop
bash $DIR/../docker_db.sh mariadb bash $DIR/../docker_db.sh mariadb
elif [ "$RDBMS" == 'postgresql' ]; then elif [ "$RDBMS" == 'postgresql' ]; then
sudo service postgres stop
bash $DIR/../docker_db.sh postgresql_9_5 bash $DIR/../docker_db.sh postgresql_9_5
elif [ "$RDBMS" == 'db2' ]; then elif [ "$RDBMS" == 'db2' ]; then
bash $DIR/../docker_db.sh db2 bash $DIR/../docker_db.sh db2
@ -22,6 +16,6 @@ elif [ "$RDBMS" == 'oracle' ]; then
bash $DIR/../docker_db.sh oracle bash $DIR/../docker_db.sh oracle
elif [ "$RDBMS" == 'mssql' ]; then elif [ "$RDBMS" == 'mssql' ]; then
bash $DIR/../docker_db.sh mssql bash $DIR/../docker_db.sh mssql
elif [ "$RDBMS" == 'hana' ]; then
bash $DIR/../docker_db.sh hana
fi fi
exec bash $DIR/build.sh

View File

@ -197,6 +197,7 @@ hana() {
chmod 777 -R $temp_dir chmod 777 -R $temp_dir
docker rm -f hana || true docker rm -f hana || true
docker run -d --name hana -p 39013:39013 -p 39017:39017 -p 39041-39045:39041-39045 -p 1128-1129:1128-1129 -p 59013-59014:59013-59014 \ docker run -d --name hana -p 39013:39013 -p 39017:39017 -p 39041-39045:39041-39045 -p 1128-1129:1128-1129 -p 59013-59014:59013-59014 \
--memory=8g \
--ulimit nofile=1048576:1048576 \ --ulimit nofile=1048576:1048576 \
--sysctl kernel.shmmax=1073741824 \ --sysctl kernel.shmmax=1073741824 \
--sysctl net.ipv4.ip_local_port_range='40000 60999' \ --sysctl net.ipv4.ip_local_port_range='40000 60999' \

View File

@ -45,7 +45,7 @@ ext {
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test', 'jdbc.pass' : 'hibernate_orm_test',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com // Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://127.0.0.1/hibernate_orm_test?preparedStatementCacheQueries=0' 'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0'
], ],
pgsql_ci : [ pgsql_ci : [
'db.dialect' : 'org.hibernate.dialect.PostgreSQL95Dialect', 'db.dialect' : 'org.hibernate.dialect.PostgreSQL95Dialect',
@ -60,14 +60,14 @@ ext {
'jdbc.driver': 'com.mysql.jdbc.Driver', 'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernateormtest', 'jdbc.user' : 'hibernateormtest',
'jdbc.pass' : 'hibernateormtest', 'jdbc.pass' : 'hibernateormtest',
'jdbc.url' : 'jdbc:mysql://localhost/hibernate_orm_test' 'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test'
], ],
mysql_docker : [ mysql_docker : [
'db.dialect' : 'org.hibernate.dialect.MySQL57Dialect', 'db.dialect' : 'org.hibernate.dialect.MySQL57Dialect',
'jdbc.driver': 'com.mysql.jdbc.Driver', 'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test', 'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mysql://127.0.0.1/hibernate_orm_test?useSSL=false' 'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test?useSSL=false'
], ],
// uses docker mysql_8_0 // uses docker mysql_8_0
mysql8_spatial_ci: [ mysql8_spatial_ci: [
@ -82,7 +82,7 @@ ext {
'jdbc.driver': 'org.mariadb.jdbc.Driver', 'jdbc.driver': 'org.mariadb.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test', 'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mariadb://127.0.0.1/hibernate_orm_test' 'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test'
], ],
mariadb_ci : [ mariadb_ci : [
'db.dialect' : 'org.hibernate.dialect.MariaDB103Dialect', 'db.dialect' : 'org.hibernate.dialect.MariaDB103Dialect',
@ -111,7 +111,7 @@ ext {
'jdbc.driver': 'oracle.jdbc.OracleDriver', 'jdbc.driver': 'oracle.jdbc.OracleDriver',
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test', 'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:oracle:thin:@localhost:1521/xe' 'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/xe'
], ],
// Use ./docker_db.sh oracle_ee to start the database // Use ./docker_db.sh oracle_ee to start the database
oracle_docker : [ oracle_docker : [
@ -140,7 +140,7 @@ ext {
'jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc.user' : 'hibernate_orm_test', 'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test', 'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:sqlserver://localhost;instance=SQLEXPRESS;databaseName=hibernate_orm_test' 'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';instance=SQLEXPRESS;databaseName=hibernate_orm_test'
], ],
mssql_ci : [ mssql_ci : [
'db.dialect' : 'org.hibernate.dialect.SQLServer2012Dialect', 'db.dialect' : 'org.hibernate.dialect.SQLServer2012Dialect',
@ -161,14 +161,14 @@ ext {
'jdbc.driver': 'com.informix.jdbc.IfxDriver', 'jdbc.driver': 'com.informix.jdbc.IfxDriver',
'jdbc.user' : 'informix', 'jdbc.user' : 'informix',
'jdbc.pass' : 'in4mix', 'jdbc.pass' : 'in4mix',
'jdbc.url' : 'jdbc:informix-sqli://127.0.0.1:9088/sysuser:INFORMIXSERVER=dev;user=informix;password=in4mix' 'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/sysuser:INFORMIXSERVER=dev;user=informix;password=in4mix'
], ],
db2 : [ db2 : [
'db.dialect' : 'org.hibernate.dialect.DB2Dialect', 'db.dialect' : 'org.hibernate.dialect.DB2Dialect',
'jdbc.driver': 'com.ibm.db2.jcc.DB2Driver', 'jdbc.driver': 'com.ibm.db2.jcc.DB2Driver',
'jdbc.user' : 'db2inst1', 'jdbc.user' : 'db2inst1',
'jdbc.pass' : 'db2inst1-pwd', 'jdbc.pass' : 'db2inst1-pwd',
'jdbc.url' : 'jdbc:db2://127.0.0.1:50000/hibern8' 'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/hibern8'
], ],
db2_ci : [ db2_ci : [
'db.dialect' : 'org.hibernate.dialect.DB2Dialect', 'db.dialect' : 'org.hibernate.dialect.DB2Dialect',
@ -190,7 +190,7 @@ ext {
'jdbc.user' : 'HIBERNATE_TEST', 'jdbc.user' : 'HIBERNATE_TEST',
'jdbc.pass' : 'H1bernate_test', 'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html // Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://localhost:30015/?statementCacheSize=0' 'jdbc.url' : 'jdbc:sap://' + dbHost + ':30015/?statementCacheSize=0'
], ],
hana_cloud : [ hana_cloud : [
'db.dialect' : 'org.hibernate.dialect.HANACloudColumnStoreDialect', 'db.dialect' : 'org.hibernate.dialect.HANACloudColumnStoreDialect',
@ -198,7 +198,7 @@ ext {
'jdbc.user' : 'HIBERNATE_TEST', 'jdbc.user' : 'HIBERNATE_TEST',
'jdbc.pass' : 'H1bernate_test', 'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html // Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://localhost:443/?encrypt=true&validateCertificate=false&statementCacheSize=0' 'jdbc.url' : 'jdbc:sap://' + dbHost + ':443/?encrypt=true&validateCertificate=false&statementCacheSize=0'
], ],
hana_vlad : [ hana_vlad : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect', 'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -206,7 +206,7 @@ ext {
'jdbc.user' : 'VLAD', 'jdbc.user' : 'VLAD',
'jdbc.pass' : 'V1ad_test', 'jdbc.pass' : 'V1ad_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html // Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://localhost:39015/?statementCacheSize=0' 'jdbc.url' : 'jdbc:sap://' + dbHost + ':39015/?statementCacheSize=0'
], ],
hana_docker : [ hana_docker : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect', 'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -216,6 +216,14 @@ ext {
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html // Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0' 'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0'
], ],
hana_ci : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
'jdbc.driver': 'com.sap.db.jdbc.Driver',
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0'
],
hana_spatial_ci : [ hana_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.hana.HANASpatialDialect', 'db.dialect' : 'org.hibernate.spatial.dialect.hana.HANASpatialDialect',
'jdbc.driver': 'com.sap.db.jdbc.Driver', 'jdbc.driver': 'com.sap.db.jdbc.Driver',
@ -231,7 +239,7 @@ ext {
'jdbc.user' : 'root', 'jdbc.user' : 'root',
'jdbc.pass' : '', 'jdbc.pass' : '',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com // Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://localhost:26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0' 'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0'
], ],
cockroachdb_spatial : [ cockroachdb_spatial : [
'db.dialect' : 'org.hibernate.spatial.dialect.cockroachdb.CockroachDB202SpatialDialect', 'db.dialect' : 'org.hibernate.spatial.dialect.cockroachdb.CockroachDB202SpatialDialect',
@ -240,7 +248,7 @@ ext {
'jdbc.user' : 'root', 'jdbc.user' : 'root',
'jdbc.pass' : '', 'jdbc.pass' : '',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com // Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://localhost:26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0' 'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0'
] ]
] ]
} }

View File

@ -251,6 +251,12 @@ test {
beforeTest { descriptor -> beforeTest { descriptor ->
//println "Starting test: " + descriptor //println "Starting test: " + descriptor
} }
// Allow to exclude specific tests
if (project.hasProperty('excludeTests')) {
filter {
excludeTestsMatching project.property('excludeTests').toString()
}
}
} }
//Create the task that runs the integration tests found from the //Create the task that runs the integration tests found from the