HHH-17982 Setup JPA 3.2 TCK testing automation for ORM 7

This commit is contained in:
Christian Beikov 2024-04-30 14:40:55 +02:00 committed by Steve Ebersole
parent 6b13f4228a
commit bc80ea7fb8
1 changed files with 6 additions and 6 deletions

View File

@ -110,18 +110,16 @@ pipeline {
steps { steps {
script { script {
def containerName def containerName
def dbHost
if ( params.RDBMS == 'postgresql' ) { if ( params.RDBMS == 'postgresql' ) {
containerName = 'postgres' containerName = 'postgres'
} }
else { else {
containerName = params.RDBMS containerName = params.RDBMS
} }
def dockerRunOptions
if ( params.RDBMS != 'derby' ) { if ( params.RDBMS != 'derby' ) {
dbHost = containerName dockerRunOptions = "--network=tck-net -e DB_HOST=${containerName}"
sh """ \ sh """ \
rm -Rf ./results
docker rm -f tck || true
while IFS= read -r container; do while IFS= read -r container; do
docker network disconnect tck-net \$container || true docker network disconnect tck-net \$container || true
done <<< \$(docker network inspect tck-net --format '{{range \$k, \$v := .Containers}}{{print \$k}}{{end}}' 2>/dev/null || true) done <<< \$(docker network inspect tck-net --format '{{range \$k, \$v := .Containers}}{{print \$k}}{{end}}' 2>/dev/null || true)
@ -131,10 +129,12 @@ pipeline {
""" """
} }
else { else {
dbHost = 'localhost' dockerRunOptions = ""
} }
sh """ \ sh """ \
docker run -v ~/.m2/repository/org/hibernate:/root/.m2/repository/org/hibernate:z --network=tck-net -e DB_HOST=${dbHost} -e RDBMS=${params.RDBMS} -e HIBERNATE_VERSION=$HIBERNATE_VERSION --name tck jakarta-tck-runner rm -Rf ./results
docker rm -f tck || true
docker run -v ~/.m2/repository/org/hibernate:/root/.m2/repository/org/hibernate:z ${dockerRunOptions} -e RDBMS=${params.RDBMS} -e HIBERNATE_VERSION=$HIBERNATE_VERSION --name tck jakarta-tck-runner
docker cp tck:/tck/persistence-tck/bin/target/failsafe-reports ./results docker cp tck:/tck/persistence-tck/bin/target/failsafe-reports ./results
docker cp tck:/tck/persistence-tck/bin/target/test-reports ./results docker cp tck:/tck/persistence-tck/bin/target/test-reports ./results
""" """