Adapt Quarkus build to test only necessary ORM bits

This commit is contained in:
Christian Beikov 2023-10-12 17:07:34 +02:00
parent ac3b5281c3
commit e95e067fb9
3 changed files with 14 additions and 101 deletions

View File

@ -1,93 +0,0 @@
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'NOT_BUILT'
return
}
pipeline {
agent {
label 'LongDuration'
}
tools {
jdk 'OpenJDK 11 Latest'
}
options {
rateLimitBuilds(throttle: [count: 1, durationName: 'day', userBoost: true])
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
}
parameters {
choice(name: 'IMAGE_JDK', choices: ['jdk11'], description: 'The JDK base image version to use for the TCK image.')
string(name: 'TCK_VERSION', defaultValue: '3.1.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
string(name: 'TCK_SHA'/* Avoid default since the version is non-final, defaultValue: '33c8a9380fbdf223e84113a4e20866b42ba2b60a46f1d8ac25d240f0bc919294'*/, description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.0/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
booleanParam(name: 'NO_SLEEP', defaultValue: true, description: 'Whether the NO_SLEEP patch should be applied to speed up the TCK execution')
}
stages {
stage('Build') {
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('openjdk:11-jdk').pull()
}
}
dir('hibernate') {
checkout scm
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.2.0-SNAPSHOT'
script {
env.HIBERNATE_VERSION = sh (
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
returnStdout: true
).trim()
}
}
dir('tck') {
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/hibernate/jakarta-tck-runner.git']]]
sh """ \
cd jpa-3.2; docker build -f Dockerfile.${params.IMAGE_JDK} -t jakarta-tck-runner --build-arg TCK_VERSION=${params.TCK_VERSION} --build-arg TCK_SHA=${params.TCK_SHA} .
"""
}
}
}
stage('Run TCK') {
steps {
sh """ \
rm -Rf ./results
docker rm -f tck || true
docker volume rm -f tck-vol || true
docker volume create tck-vol
docker run -v ~/.m2/repository/org/hibernate:/root/.m2/repository/org/hibernate:z -v tck-vol:/tck/persistence-tck/tmp/:z -e NO_SLEEP=${params.NO_SLEEP} -e HIBERNATE_VERSION=$HIBERNATE_VERSION --name tck jakarta-tck-runner
docker cp tck:/tck/persistence-tck/tmp/ ./results
"""
archiveArtifacts artifacts: 'results/**'
script {
failures = sh (
script: """ \
set +x
while read line; do
if [[ "\$line" != *"Passed." ]]; then
echo "\$line"
fi
done <results/JTreport/text/summary.txt
""",
returnStdout: true
).trim()
if ( !failures.isEmpty() ) {
echo "Some TCK tests failed:"
echo failures
currentBuild.result = 'FAILURE'
}
}
}
}
}
post {
always {
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
}
}
}
}

View File

@ -18,9 +18,6 @@ pipeline {
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3')) buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true) disableConcurrentBuilds(abortPrevious: true)
} }
environment {
MAVEN_OPTS = '-Xmx2g -XX:MaxMetaspaceSize=1g'
}
stages { stages {
stage('Build') { stage('Build') {
steps { steps {
@ -33,11 +30,19 @@ pipeline {
).trim() ).trim()
} }
dir('.release/quarkus') { dir('.release/quarkus') {
// checkout scmGit(branches: [[name: '*/orm-update']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/beikov/quarkus.git']]) sh "git clone -b 3.2 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/quarkusio/quarkus.git']])
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml" sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
sh './mvnw -Dquickly install' // Need to override the default maven configuration this way, because there is no other way to do it
sh './mvnw -pl :quarkus-hibernate-orm -amd -pl "!integration-tests/kafka-oauth-keycloak" verify -Dstart-containers -Dtest-containers' sh "sed -i 's/-Xmx5g/-Xmx1920m/' ./.mvn/jvm.config"
sh "echo -e '\\n-XX:MaxMetaspaceSize=768m'>>./.mvn/jvm.config"
sh "./mvnw -Dquickly install"
// Need to kill the gradle daemons started during the Maven install run
sh "pkill -f '.*GradleDaemon.*' || true"
// Need to override the default maven configuration this way, because there is no other way to do it
sh "sed -i 's/-Xmx1920m/-Xmx1372m/' ./.mvn/jvm.config"
sh "sed -i 's/MaxMetaspaceSize=768m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
def excludes = "'!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/maven,!docs,!integration-tests/mongodb-client,!integration-tests/mongodb-panache,!integration-tests/mongodb-panache-kotlin,!integration-tests/mongodb-devservices,!integration-tests/mongodb-rest-data-panache,!integration-tests/liquibase-mongodb,!extensions/mongodb-client/deployment,!extensions/liquibase-mongodb/deployment,!extensions/panache/mongodb-panache/deployment,!extensions/panache/mongodb-panache-kotlin/deployment,!extensions/panache/mongodb-panache-kotlin/runtime,!extensions/panache/mongodb-rest-data-panache/deployment,!extensions/panache/mongodb-panache-common/deployment'"
sh "TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true ./mvnw -pl :quarkus-hibernate-orm -amd -pl ${excludes} verify -Dstart-containers -Dtest-containers -Dskip.gradle.build"
} }
} }
} }

View File

@ -62,7 +62,8 @@ pipeline {
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true).trim() def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true).trim()
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') { if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
print "INFO: Release skipped because last commits were for the previous release" print "INFO: Release skipped because last commits were for the previous release"
currentBuild.result = 'ABORTED' currentBuild.getRawBuild().getExecutor().interrupt(Result.NOT_BUILT)
sleep(1) // Interrupt is not blocking and does not take effect immediately.
return return
} }