HHH-16876 Update Oracle testing to 23c
This commit is contained in:
parent
875e0cac3c
commit
7cb740594e
|
@ -177,7 +177,7 @@ The following table illustrates a list of commands for various databases that ca
|
|||
|
||||
|Oracle XE
|
||||
|`./docker_db.sh oracle`
|
||||
|`./gradlew test -Pdb=oracle_ci`
|
||||
|`./gradlew test -Pdb=oracle_free_ci`
|
||||
|
||||
|DB2
|
||||
|`./docker_db.sh db2`
|
||||
|
|
|
@ -20,6 +20,9 @@ elif [ "$RDBMS" == "edb" ] || [ "$RDBMS" == "edb_10" ]; then
|
|||
goal="-Pdb=edb_ci -DdbHost=localhost:5444"
|
||||
elif [ "$RDBMS" == "oracle" ]; then
|
||||
goal="-Pdb=oracle_ci"
|
||||
elif [ "$RDBMS" == "oracle_xe" ]; then
|
||||
# I have no idea why, but these tests don't seem to work on CI...
|
||||
goal="-Pdb=oracle_xe_ci"
|
||||
elif [ "$RDBMS" == "oracle_atps" ]; then
|
||||
echo "Managing Oracle Autonomous Database..."
|
||||
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=autonomous&hostname=`hostname`" -H 'accept: application/json')
|
||||
|
|
96
docker_db.sh
96
docker_db.sh
|
@ -566,6 +566,85 @@ grant all privileges to hibernate_orm_test;
|
|||
EOF\""
|
||||
}
|
||||
|
||||
oracle_free_setup() {
|
||||
HEALTHSTATUS=
|
||||
until [ "$HEALTHSTATUS" == "healthy" ];
|
||||
do
|
||||
echo "Waiting for Oracle Free to start..."
|
||||
sleep 5;
|
||||
# On WSL, health-checks intervals don't work for Podman, so run them manually
|
||||
if command -v podman > /dev/null; then
|
||||
$PRIVILEGED_CLI $CONTAINER_CLI healthcheck run oracle > /dev/null
|
||||
fi
|
||||
HEALTHSTATUS="`$PRIVILEGED_CLI $CONTAINER_CLI inspect -f $HEALTCHECK_PATH oracle`"
|
||||
HEALTHSTATUS=${HEALTHSTATUS##+( )} #Remove longest matching series of spaces from the front
|
||||
HEALTHSTATUS=${HEALTHSTATUS%%+( )} #Remove longest matching series of spaces from the back
|
||||
done
|
||||
sleep 2;
|
||||
echo "Oracle successfully started"
|
||||
# We increase file sizes to avoid online resizes as that requires lots of CPU which is restricted in XE
|
||||
$PRIVILEGED_CLI $CONTAINER_CLI exec oracle bash -c "source /home/oracle/.bashrc; bash -c \"
|
||||
cat <<EOF | \$ORACLE_HOME/bin/sqlplus / as sysdba
|
||||
set timing on
|
||||
-- Remove DISABLE_OOB parameter from Listener configuration and restart it
|
||||
!echo Enabling OOB for Listener...
|
||||
!echo NAMES.DIRECTORY_PATH=\(EZCONNECT,TNSNAMES\) > /opt/oracle/oradata/dbconfig/FREE/sqlnet.ora
|
||||
!lsnrctl reload
|
||||
-- Increasing redo logs
|
||||
alter database add logfile group 4 '\$ORACLE_BASE/oradata/FREE/redo04.log' size 500M reuse;
|
||||
alter database add logfile group 5 '\$ORACLE_BASE/oradata/FREE/redo05.log' size 500M reuse;
|
||||
alter database add logfile group 6 '\$ORACLE_BASE/oradata/FREE/redo06.log' size 500M reuse;
|
||||
alter system switch logfile;
|
||||
alter system switch logfile;
|
||||
alter system switch logfile;
|
||||
alter system checkpoint;
|
||||
alter database drop logfile group 1;
|
||||
alter database drop logfile group 2;
|
||||
alter database drop logfile group 3;
|
||||
!rm \$ORACLE_BASE/oradata/FREE/redo01.log
|
||||
!rm \$ORACLE_BASE/oradata/FREE/redo02.log
|
||||
!rm \$ORACLE_BASE/oradata/FREE/redo03.log
|
||||
|
||||
-- Increasing SYSAUX data file
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/sysaux01.dbf' resize 600M;
|
||||
|
||||
-- Modifying database init parameters
|
||||
alter system set open_cursors=1000 sid='*' scope=both;
|
||||
alter system set session_cached_cursors=500 sid='*' scope=spfile;
|
||||
alter system set db_securefile=ALWAYS sid='*' scope=spfile;
|
||||
alter system set dispatchers='(PROTOCOL=TCP)(SERVICE=FREEXDB)(DISPATCHERS=0)' sid='*' scope=spfile;
|
||||
alter system set recyclebin=OFF sid='*' SCOPE=SPFILE;
|
||||
|
||||
-- Comment the 2 next lines to be able to use Diagnostics Pack features
|
||||
alter system set sga_target=0m sid='*' scope=both;
|
||||
-- alter system set statistics_level=BASIC sid='*' scope=spfile;
|
||||
|
||||
-- Restart the database
|
||||
SHUTDOWN IMMEDIATE;
|
||||
STARTUP MOUNT;
|
||||
ALTER DATABASE OPEN;
|
||||
|
||||
-- Switch to the FREEPDB1 pluggable database
|
||||
alter session set container=freepdb1;
|
||||
|
||||
-- Modify FREEPDB1 datafiles and tablespaces
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/system01.dbf' resize 320M;
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/sysaux01.dbf' resize 360M;
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/undotbs01.dbf' resize 400M;
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/undotbs01.dbf' autoextend on next 16M;
|
||||
alter database tempfile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/temp01.dbf' resize 400M;
|
||||
alter database tempfile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/temp01.dbf' autoextend on next 16M;
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/users01.dbf' resize 100M;
|
||||
alter database datafile '\$ORACLE_BASE/oradata/FREE/FREEPDB1/users01.dbf' autoextend on next 16M;
|
||||
alter tablespace USERS nologging;
|
||||
alter tablespace SYSTEM nologging;
|
||||
alter tablespace SYSAUX nologging;
|
||||
|
||||
create user hibernate_orm_test identified by hibernate_orm_test quota unlimited on users;
|
||||
grant all privileges to hibernate_orm_test;
|
||||
EOF\""
|
||||
}
|
||||
|
||||
oracle_setup_old() {
|
||||
HEALTHSTATUS=
|
||||
until [ "$HEALTHSTATUS" == "healthy" ];
|
||||
|
@ -700,7 +779,7 @@ EOF
|
|||
}
|
||||
|
||||
oracle() {
|
||||
oracle_21
|
||||
oracle_23
|
||||
}
|
||||
|
||||
oracle_11() {
|
||||
|
@ -731,6 +810,20 @@ oracle_21() {
|
|||
oracle_setup
|
||||
}
|
||||
|
||||
oracle_23() {
|
||||
$PRIVILEGED_CLI $CONTAINER_CLI rm -f oracle || true
|
||||
disable_userland_proxy
|
||||
# We need to use the defaults
|
||||
# SYSTEM/Oracle18
|
||||
$PRIVILEGED_CLI $CONTAINER_CLI run --name oracle -d -p 1521:1521 -e ORACLE_PASSWORD=Oracle18 \
|
||||
--health-cmd healthcheck.sh \
|
||||
--health-interval 5s \
|
||||
--health-timeout 5s \
|
||||
--health-retries 10 \
|
||||
docker.io/gvenzl/oracle-free:23-full
|
||||
oracle_free_setup
|
||||
}
|
||||
|
||||
hana() {
|
||||
temp_dir=$(mktemp -d)
|
||||
echo '{"master_password" : "H1bernate_test"}' >$temp_dir/password.json
|
||||
|
@ -985,6 +1078,7 @@ if [ -z ${1} ]; then
|
|||
echo -e "\tmysql_8_0"
|
||||
echo -e "\tmysql_5_7"
|
||||
echo -e "\toracle"
|
||||
echo -e "\toracle_23"
|
||||
echo -e "\toracle_21"
|
||||
echo -e "\toracle_11"
|
||||
echo -e "\tpostgresql"
|
||||
|
|
|
@ -141,6 +141,14 @@ ext {
|
|||
'connection.init_sql' : ''
|
||||
],
|
||||
oracle_ci : [
|
||||
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
|
||||
'jdbc.driver': 'oracle.jdbc.OracleDriver',
|
||||
'jdbc.user' : 'hibernate_orm_test',
|
||||
'jdbc.pass' : 'hibernate_orm_test',
|
||||
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/freepdb1',
|
||||
'connection.init_sql' : ''
|
||||
],
|
||||
oracle_xe_ci : [
|
||||
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
|
||||
'jdbc.driver': 'oracle.jdbc.OracleDriver',
|
||||
'jdbc.user' : 'hibernate_orm_test',
|
||||
|
|
|
@ -87,6 +87,7 @@ public class FilterParameterTests {
|
|||
@SkipForDialect(dialectClass = CockroachDialect.class, matchSubTypes = true, reason = "Cockroach silently converts a boolean to string types")
|
||||
@SkipForDialect(dialectClass = PostgresPlusDialect.class, reason = "PostgresPlus silently converts a boolean to string types")
|
||||
@SkipForDialect(dialectClass = FirebirdDialect.class, reason = "Firebird silently converts a boolean to string")
|
||||
@SkipForDialect(dialectClass = OracleDialect.class, majorVersion = 23, reason = "Oracle 23 interprets Y and T as true and N and F as false, so this works")
|
||||
public void testYesNoMismatch(SessionFactoryScope scope) {
|
||||
scope.inTransaction( (session) -> {
|
||||
final EntityOne loaded = session.byId( EntityOne.class ).load( 1 );
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.query;
|
||||
|
||||
import org.hibernate.dialect.OracleDialect;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.Jira;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.hibernate.testing.orm.junit.SkipForDialect;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -51,6 +54,7 @@ public class EntityValuedInSubqueryGroupAndOrderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SkipForDialect(dialectClass = OracleDialect.class, majorVersion = 23, reason = "Oracle 23c bug")
|
||||
public void testInSubqueryGroupBy(SessionFactoryScope scope) {
|
||||
scope.inTransaction( session -> {
|
||||
final EntityB result = session.createQuery(
|
||||
|
|
|
@ -50,6 +50,7 @@ tasks.test {
|
|||
'mysql_ci',
|
||||
'oracle',
|
||||
'oracle_ci',
|
||||
'oracle_xe_ci',
|
||||
'mssql',
|
||||
'mssql_ci'
|
||||
].contains( project.db )
|
||||
|
|
Loading…
Reference in New Issue