Skip to content

Ci fixes #10697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 5, 2025
Merged

Ci fixes #10697

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ stage('Configure') {
// We want to enable preview features when testing newer builds of OpenJDK:
// even if we don't use these features, just enabling them can cause side effects
// and it's useful to test that.
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,14 @@ public void testListaggWithFilterAndWindow(SessionFactoryScope scope) {
}

/*
* Skipped for MySQL 9.2: The test fails due to a regression in MySQL 9.2, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
* Skipped for MySQL 8.0: The test fails due to a regression in MySQL 8.0.x, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
* This is a MySQL issue, not a problem in the dialect implementation.
*/
@Test
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 8, reason = "https://bugs.mysql.com/bug.php?id=117765")
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, reason = "https://bugs.mysql.com/bug.php?id=117765")
public void testListaggWithNullsClause(SessionFactoryScope scope) {
scope.inTransaction( session -> {
HibernateCriteriaBuilder cb = session.getCriteriaBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,15 @@ public void testListaggWithFilter(SessionFactoryScope scope) {
}

/*
* Skipped for MySQL 9.2: The test fails due to a regression in MySQL 9.2, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
* Skipped for MySQL 8.0: The test fails due to a regression in MySQL 8.0.x, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
* This is a MySQL issue, not a problem in the dialect implementation.
*/
@Test
@JiraKey( value = "HHH-15360")
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 8, reason = "https://bugs.mysql.com/bug.php?id=117765")
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, reason = "https://bugs.mysql.com/bug.php?id=117765")
public void testListaggWithNullsClause(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.hibernate.annotations.Array;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.hibernate.type.SqlTypes;

import org.hibernate.testing.orm.junit.DomainModel;
Expand Down Expand Up @@ -168,6 +169,7 @@ public void testVectorDims(SessionFactoryScope scope) {
}

@Test
@SkipForDialect(dialectClass = OracleDialect.class, reason = "Oracle 23.9 bug")
public void testVectorNorm(SessionFactoryScope scope) {
scope.inTransaction( em -> {
//tag::vector-norm-example[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.hibernate.annotations.Array;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.hibernate.type.SqlTypes;

import org.hibernate.testing.orm.junit.DomainModel;
Expand Down Expand Up @@ -167,6 +168,7 @@ public void testVectorDims(SessionFactoryScope scope) {
}

@Test
@SkipForDialect(dialectClass = OracleDialect.class, reason = "Oracle 23.9 bug")
public void testVectorNorm(SessionFactoryScope scope) {
scope.inTransaction( em -> {
//tag::vector-norm-example[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.hibernate.annotations.Array;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.hibernate.type.SqlTypes;

import org.hibernate.testing.orm.junit.DomainModel;
Expand Down Expand Up @@ -186,6 +187,7 @@ public void testVectorDims(SessionFactoryScope scope) {
}

@Test
@SkipForDialect(dialectClass = OracleDialect.class, reason = "Oracle 23.9 bug")
public void testVectorNorm(SessionFactoryScope scope) {
scope.inTransaction( em -> {
//tag::vector-norm-example[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.hibernate.annotations.Array;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.hibernate.type.SqlTypes;

import org.hibernate.testing.orm.junit.DomainModel;
Expand Down Expand Up @@ -187,6 +188,7 @@ public void testVectorDims(SessionFactoryScope scope) {
}

@Test
@SkipForDialect(dialectClass = OracleDialect.class, reason = "Oracle 23.9 bug")
public void testVectorNorm(SessionFactoryScope scope) {
scope.inTransaction( em -> {
//tag::vector-norm-example[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public void execute(JavaCompile compileTask) {
@Override
public void execute(Task task) {
project.getLogger().lifecycle(
"Compiling with '{}'",
compileTask.getJavaCompiler().get().getMetadata().getInstallationPath()
"Compiling with '{}' to release '{}'",
compileTask.getJavaCompiler().get().getMetadata().getInstallationPath(),
compileTask.getOptions().getRelease().get()
);
}
}
Expand Down
32 changes: 32 additions & 0 deletions tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright Red Hat Inc. and Hibernate Authors
*/
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.api.internal.provider.DefaultProvider

plugins {
id 'java-gradle-plugin'
Expand Down Expand Up @@ -119,6 +120,37 @@ if ( !jdkVersions.explicit ) {
else {
logger.warn( "[WARN] Toolchains are not yet supported for Groovy compilation." +
" Using the JDK that runs Gradle for Groovy compilation." )
if ( jdkVersions.test.explicit && jdkVersions.test.launcher.asInt() > jdkVersions.min.asInt() ) {
// Configure the gradle plugin to also compile test to at most the orm.jdk.min version,
// because the test will have to be able to run with a JVM of version orm.jdk.min
tasks.named( "compileTestJava", JavaCompile ).configure {
options.release = Math.min( jdkVersions.test.compiler.asInt(), jdkVersions.min.asInt() )
}
// Must configure the test launcher to a version <= orm.jdk.max, because the tests invoke gradle,
// which inherently can only run with a JDK up to orm.jdk.max.
// Since we only support running Gradle with JDKs in the range of orm.jdk.min up to orm.jdk.max,
// we use a test java launcher for the latest available/configured JDK version
tasks.named( "test", Test ).configure {
def launcher = javaToolchains.launcherFor {
languageVersion = jdkVersions.min
}
for ( int version = jdkVersions.min.asInt() + 1; version <= jdkVersions.max.asInt(); version++ ) {
launcher = new DefaultProvider(() -> {
try {
return javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of( version )
}.get()
}
catch (GradleException ex) {
// JavaToolchainQueryService unfortunately throws an exception if a version is not found,
// so we have to catch the exception and return null here to allow a fallback
return null
}
}).orElse( launcher )
}
javaLauncher = launcher
}
}
}

tasks.publish.enabled !ormBuildDetails.hibernateVersion.isSnapshot
Expand Down
Loading