You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ma...@apache.org on 2026/08/25 19:39:26 UTC
(grails-core) 04/08: build: Preserve test-fixtures variants during functional test substitution
This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch feat/move-to-testFixtures
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 954e60cec9138ff2fbd26faa32eebcb8538adfb4
Author: Mattias Reichel <ma...@gmail.com>
AuthorDate: Tue Aug 25 17:08:41 2026 +0200
build: Preserve test-fixtures variants during functional test substitution
---
gradle/functional-test-config.gradle | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/gradle/functional-test-config.gradle b/gradle/functional-test-config.gradle
index 7b11bbdfa2..20b39db9ca 100644
--- a/gradle/functional-test-config.gradle
+++ b/gradle/functional-test-config.gradle
@@ -30,7 +30,8 @@ if (!rootProject.ext.has('substitutableFunctionalTestProjectsCache')) {
name: subproject.name,
group: subproject.group,
artifactId: subproject.findProperty('pomArtifactId') ?: subproject.name,
- cliArtifactId: subproject.findProperty('cliArtifactId')
+ cliArtifactId: subproject.findProperty('cliArtifactId'),
+ hasTestFixtures: subproject.plugins.hasPlugin('java-test-fixtures')
]
}
)
@@ -42,12 +43,9 @@ configurations.configureEach {
// included will be substituted with the local projects in this repository instead of pulling upstream.
for (def substitutionInfo : substitutableProjects) {
def substitutedArtifact = "${substitutionInfo.group}:${substitutionInfo.artifactId}" as String
- //TODO: This does not handle libraries that are both test fixtures & a libraries like grails-data-mongodb,
- // see grails-test-examples-mongodb-base, & grails-test-examples-mongodb-hibernate5 for project() workaround
if (substitutionInfo.name == 'grails-bom') {
substitute module(substitutedArtifact) using platform(project(':grails-bom'))
- }
- else if(substitutionInfo.name == 'grails-geb') {
+ } else if (substitutionInfo.hasTestFixtures) {
def selector = substitution.variant(module(substitutedArtifact)) { details ->
details.capabilities { handler ->
handler.requireCapability("${substitutedArtifact}-test-fixtures" as String)
@@ -59,8 +57,7 @@ configurations.configureEach {
}
}
substitute selector using replacement
- }
- else {
+ } else {
substitute module(substitutedArtifact) using project(":${substitutionInfo.name}")
}