jamesfredley opened a new pull request, #15561:
URL: https://github.com/apache/grails-core/pull/15561

   ## Summary
   
   - Merge the separate `functional` and `hibernate5Functional` CI jobs into a 
single `functional` job with a `hibernate-version: ['5', '7']` matrix
   - Add Gradle dependency substitution so all 20+ general functional tests 
automatically switch from Hibernate 5 to Hibernate 7 via `-PhibernateVersion=7` 
- no duplicated test projects needed
   - Add `skipHibernate5Tests` / `skipHibernate7Tests` properties to 
`functional-test-config.gradle`
   
   ## Problem
   
   PR #15530 introduces `grails-data-hibernate7` alongside 
`grails-data-hibernate5`. Currently:
   
   1. **20 general functional tests** (app1, gorm, scaffolding, etc.) are 
hardcoded to `grails-data-hibernate5` and only run against Hibernate 5
   2. **12 hibernate-labeled test projects** exist in both 
`grails-test-examples/hibernate5/` and `grails-test-examples/hibernate7/` as 
full copies
   3. CI has separate `functional` and `hibernate5Functional` jobs but no 
`hibernate7Functional` job - Hibernate 7 functional test coverage is incomplete
   4. `skipHibernate5Tests` and `skipHibernate7Tests` were not honored by 
`functional-test-config.gradle`
   
   ## Solution
   
   ### Gradle: dependency substitution via `-PhibernateVersion=7`
   
   In `functional-test-config.gradle`, when `-PhibernateVersion=7` is passed 
and the project is a **general** functional test (not labeled 
`hibernate5`/`hibernate7`/`mongodb`):
   
   - `grails-data-hibernate5` is substituted with `grails-data-hibernate7` via 
`resolutionStrategy.dependencySubstitution`
   - `grails-data-hibernate5-spring-boot` is substituted with 
`grails-data-hibernate7-spring-boot`
   - Hibernate 5-specific runtime deps (`hibernate-ehcache`, 
`jboss-transaction-api`) are excluded since they have no Hibernate 7 equivalent
   
   This means **zero changes to individual test project build files** - the 
substitution happens centrally.
   
   ### CI: unified matrix job
   
   The old structure:
   
   | Job | What it ran |
   |-----|-------------|
   | `functional` | General tests only (skipped h5/mongo) |
   | `hibernate5Functional` | h5-labeled tests only |
   | _(missing)_ | No h7 coverage for general tests |
   
   The new structure:
   
   | Job | Matrix | What it runs |
   |-----|--------|-------------|
   | `functional` | `hibernate-version: ['5', '7']` x `java: [17, 21, 25]` | 
**All** functional tests (general + matching labeled) per Hibernate version |
   
   Each matrix slot:
   - Sets `-PhibernateVersion=5` or `7` (triggers dep substitution for general 
tests)
   - Sets `-PskipHibernate7Tests` or `-PskipHibernate5Tests` (excludes the 
opposite version's labeled projects)
   - Skips MongoDB tests (separate job)
   
   ### Skip property support
   
   Added `skipHibernate5Tests` and `skipHibernate7Tests` to the `onlyIf` block 
in `functional-test-config.gradle`. Previously these properties were only 
checked in `hibernate5-test-config.gradle` and `hibernate7-test-config.gradle` 
(unit test configs), not in the functional test config.
   
   ## Files changed
   
   - `.github/workflows/gradle.yml` - Merge two jobs into one matrix job, 
update `publish` job dependencies
   - `gradle/functional-test-config.gradle` - Add dependency substitution, 
exclusions, and skip properties
   
   ## Local testing
   
   ```bash
   # Run all functional tests with Hibernate 5 (default)
   ./gradlew -PonlyFunctionalTests -PskipMongodbTests -PskipHibernate7Tests 
check
   
   # Run all functional tests with Hibernate 7
   ./gradlew -PonlyFunctionalTests -PskipMongodbTests -PskipHibernate5Tests 
-PhibernateVersion=7 check
   ```
   


-- 
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