jamesfredley commented on code in PR #15561:
URL: https://github.com/apache/grails-core/pull/15561#discussion_r3322209943


##########
gradle/functional-test-config.gradle:
##########
@@ -21,6 +21,27 @@ rootProject.subprojects
         .findAll { !(it.name in testProjects) && !(it.name in docProjects) && 
!(it.name in cliProjects) }
         .each { project.evaluationDependsOn(it.path) }
 
+// Determine which Hibernate version to use for general functional tests.
+// Pass -PhibernateVersion=7 to run general functional tests against Hibernate 
7 instead of 5.
+def targetHibernateVersion = project.findProperty('hibernateVersion') ?: '5'
+boolean isHibernateSpecificProject = 
project.name.startsWith('grails-test-examples-hibernate5') ||
+        project.name.startsWith('grails-test-examples-hibernate7')
+boolean isMongoProject = 
project.name.startsWith('grails-test-examples-mongodb')
+boolean isGeneralFunctionalTest = !isHibernateSpecificProject && 
!isMongoProject
+

Review Comment:
   Done. `hibernateVersion` is now normalized and validated up front: any value 
other than `'5'` or `'7'` throws a `GradleException` ("Unsupported 
hibernateVersion '...'. Expected '5' or '7'."), so the build fails fast on 
typos/misconfiguration instead of silently falling back to Hibernate 5 behavior.



##########
gradle/functional-test-config.gradle:
##########
@@ -80,6 +122,20 @@ tasks.withType(Test).configureEach { Test task ->
             }
         }
 
+        // Skip hibernate5-labeled projects when -PskipHibernate5Tests is set
+        if (project.hasProperty('skipHibernate5Tests')) {
+            if (!isHibernate5) {
+                return false
+            }
+        }
+
+        // Skip hibernate7-labeled projects when -PskipHibernate7Tests is set
+        if (project.hasProperty('skipHibernate7Tests')) {
+            if (!isHibernate7) {
+                return false
+            }
+        }

Review Comment:
   Done. The booleans were redefined with positive semantics that match their 
names: `isHibernate5Project`/`isHibernate7Project` are now direct 
`startsWith('grails-test-examples-hibernateN')` checks, and the 
`skipHibernate5Tests`/`skipHibernate7Tests` `onlyIf` conditions were updated to 
`project.hasProperty('skipHibernateNTests') && isHibernateNProject`. The 
inverted/negated logic is gone, so the skip conditions read the way they sound.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to