You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2026/04/28 23:01:14 UTC
(grails-core) branch springSecurityUpdates created (now 50a42e49d8)
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a change to branch springSecurityUpdates
in repository https://gitbox.apache.org/repos/asf/grails-core.git
at 50a42e49d8 Update to Boot 4.x compatible version of Spring Security
This branch includes the following new commits:
new 52b0ebb5c4 Ability to run tests without running forcing the run of all tasks
new 50a42e49d8 Update to Boot 4.x compatible version of Spring Security
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(grails-core) 02/02: Update to Boot 4.x compatible version of Spring Security
Posted by jd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch springSecurityUpdates
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 50a42e49d83704000d703fd26d7d9c7df928b672
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Tue Apr 28 19:00:42 2026 -0400
Update to Boot 4.x compatible version of Spring Security
---
gradle.properties | 2 +-
gradle/boot4-disabled-integration-test-config.gradle | 1 -
grails-test-examples/app1/build.gradle | 1 -
grails-test-examples/app3/build.gradle | 1 -
grails-test-examples/exploded/build.gradle | 1 -
grails-test-examples/mongodb/test-data-service/build.gradle | 1 -
grails-test-examples/plugins/exploded/build.gradle | 1 -
7 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/gradle.properties b/gradle.properties
index cba77cdc88..1155d31dbd 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -57,7 +57,7 @@ micronautPlatformVersion=5.0.0-M2
# Libraries only specific to test apps, these should not be exposed
ersatzVersion=4.0.1
-grailsSpringSecurityVersion=7.0.2-SNAPSHOT
+grailsSpringSecurityVersion=8.0.0-SNAPSHOT
jbossTransactionApiVersion=2.0.0.Final
# build dependencies for code quality checks
diff --git a/gradle/boot4-disabled-integration-test-config.gradle b/gradle/boot4-disabled-integration-test-config.gradle
index 01fc04a35f..e56dd57a00 100644
--- a/gradle/boot4-disabled-integration-test-config.gradle
+++ b/gradle/boot4-disabled-integration-test-config.gradle
@@ -21,7 +21,6 @@
// external plugin/library incompatibilities with Spring Boot 4 / Spring Framework 7.
//
// Known blockers:
-// - grails-spring-security: ReflectionUtils.getApplication() removed in Spring Boot 4
// - SiteMesh3: Decorator/layout not compatible with Spring Framework 7
//
// Re-enable each module's integrationTest when its blocking dependency is updated.
diff --git a/grails-test-examples/app1/build.gradle b/grails-test-examples/app1/build.gradle
index 7e3547c7a8..7876d7281a 100644
--- a/grails-test-examples/app1/build.gradle
+++ b/grails-test-examples/app1/build.gradle
@@ -92,6 +92,5 @@ test {
apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/test-webjar-asset-config.gradle')
- from rootProject.layout.projectDirectory.file('gradle/boot4-disabled-integration-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
}
diff --git a/grails-test-examples/app3/build.gradle b/grails-test-examples/app3/build.gradle
index 2422c7a0e7..7a9bd1ac47 100644
--- a/grails-test-examples/app3/build.gradle
+++ b/grails-test-examples/app3/build.gradle
@@ -67,6 +67,5 @@ grails {
apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
- from rootProject.layout.projectDirectory.file('gradle/boot4-disabled-integration-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
}
diff --git a/grails-test-examples/exploded/build.gradle b/grails-test-examples/exploded/build.gradle
index 71cf44b5ab..58113281ce 100644
--- a/grails-test-examples/exploded/build.gradle
+++ b/grails-test-examples/exploded/build.gradle
@@ -65,6 +65,5 @@ grails {
apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
- from rootProject.layout.projectDirectory.file('gradle/boot4-disabled-integration-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
}
diff --git a/grails-test-examples/mongodb/test-data-service/build.gradle b/grails-test-examples/mongodb/test-data-service/build.gradle
index b6ab108087..12e4a5d364 100644
--- a/grails-test-examples/mongodb/test-data-service/build.gradle
+++ b/grails-test-examples/mongodb/test-data-service/build.gradle
@@ -54,6 +54,5 @@ dependencies {
apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
- from rootProject.layout.projectDirectory.file('gradle/boot4-disabled-integration-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
}
diff --git a/grails-test-examples/plugins/exploded/build.gradle b/grails-test-examples/plugins/exploded/build.gradle
index ab8a0ea3b0..6977b56426 100644
--- a/grails-test-examples/plugins/exploded/build.gradle
+++ b/grails-test-examples/plugins/exploded/build.gradle
@@ -51,6 +51,5 @@ dependencies {
apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
- from rootProject.layout.projectDirectory.file('gradle/boot4-disabled-integration-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
}
(grails-core) 01/02: Ability to run tests without running forcing the run of all tasks
Posted by jd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch springSecurityUpdates
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 52b0ebb5c46fdac25c02ca847267e7c2e537e39d
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Sat Apr 25 12:29:04 2026 -0400
Ability to run tests without running forcing the run of all tasks
---
DEVELOPMENT.md | 12 ++++++++++++
build-logic/docs-core/build.gradle | 6 ++++++
build.gradle | 4 ++++
gradle/functional-test-config.gradle | 5 +++++
gradle/grails-data-tck-config.gradle | 6 ++++++
gradle/hibernate5-test-config.gradle | 5 +++++
gradle/mongodb-forked-test-config.gradle | 5 +++++
gradle/mongodb-test-config.gradle | 5 +++++
gradle/test-config.gradle | 7 +++++--
grails-forge/build.gradle | 9 +++++++++
grails-forge/gradle/test-config.gradle | 5 +++++
grails-gradle/build.gradle | 4 ++++
grails-gradle/gradle/test-config.gradle | 5 +++++
grails-test-suite-uber/build.gradle | 5 +++++
14 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 8363b456fb..f7480de073 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -66,5 +66,17 @@ Example with multiple tags:
./gradlew iT -PincludeTestTags=geb,api
```
+## Environment variables
+
+* `DO_NOT_CACHE_TESTS` - set to `1` (or any truthy value) to force every `Test` task to run
+ every invocation, without needing `--rerun-tasks`. This skips both Gradle's build cache
+ and the `up-to-date` check for tests, while leaving the rest of the build (compilation,
+ resource processing, etc.) cacheable. Useful when chasing flaky tests that depend on
+ test execution order across runs.
+
+ ```
+ DO_NOT_CACHE_TESTS=1 ./gradlew :grails-gsp:test
+ ```
+
## Start a mongo docker container (containers will start by default)
`docker run -d --name mongo-on-docker -p 27017:27017 mongo`
\ No newline at end of file
diff --git a/build-logic/docs-core/build.gradle b/build-logic/docs-core/build.gradle
index c5fabc139b..95ffb71ae0 100644
--- a/build-logic/docs-core/build.gradle
+++ b/build-logic/docs-core/build.gradle
@@ -87,6 +87,12 @@ def java17moduleReflectionCompatibilityArguments = [
'--add-opens=java.base/java.util=ALL-UNNAMED'
]
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ boolean doNotCacheTests = System.getenv().get('DO_NOT_CACHE_TESTS') as Boolean
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'onlyFunctionalTests',
diff --git a/build.gradle b/build.gradle
index eb7b998919..36371cc2df 100644
--- a/build.gradle
+++ b/build.gradle
@@ -36,6 +36,10 @@ ext {
DateTimeFormatter.ISO_DATE.format(LocalDate.ofInstant(buildInstant as Instant, ZoneOffset.UTC))
buildDate = (buildInstant as Instant).atZone(ZoneOffset.UTC) // for reproducible builds
isCiBuild = System.getenv().get('CI') as Boolean
+ // Set DO_NOT_CACHE_TESTS=1 to force test tasks to re-run on every invocation without
+ // needing --rerun-tasks. Useful for repeatedly running the same test command while
+ // chasing flaky tests across runs.
+ doNotCacheTests = System.getenv().get('DO_NOT_CACHE_TESTS') as Boolean
configuredTestParallel = findProperty('maxTestParallel') as Integer ?: (isCiBuild ? 4 : Runtime.runtime.availableProcessors() * 3 / 4 as int ?: 1)
excludeUnusedTransDeps = findProperty('excludeUnusedTransDeps')
diff --git a/gradle/functional-test-config.gradle b/gradle/functional-test-config.gradle
index c642b2eeb8..d628858b7d 100644
--- a/gradle/functional-test-config.gradle
+++ b/gradle/functional-test-config.gradle
@@ -62,6 +62,11 @@ tasks.withType(Test).configureEach { Test task ->
boolean isHibernate5 = !project.name.startsWith('grails-test-examples-hibernate5')
boolean isMongo = !project.name.startsWith('grails-test-examples-mongodb')
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ task.outputs.cacheIf { !doNotCacheTests }
+ task.outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
if (project.hasProperty('skipFunctionalTests')) {
return false
diff --git a/gradle/grails-data-tck-config.gradle b/gradle/grails-data-tck-config.gradle
index 91f301cef7..63f417cc76 100644
--- a/gradle/grails-data-tck-config.gradle
+++ b/gradle/grails-data-tck-config.gradle
@@ -59,6 +59,12 @@ cleanupTask.configure { Task it ->
tasks.withType(Test).configureEach { Test it ->
it.dependsOn(extractTck)
+
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ it.outputs.cacheIf { !doNotCacheTests }
+ it.outputs.upToDateWhen { !doNotCacheTests }
+
it.onlyIf {
if (project.hasProperty('onlyFunctionalTests')) {
return false
diff --git a/gradle/hibernate5-test-config.gradle b/gradle/hibernate5-test-config.gradle
index 36f5841a48..2b5882b036 100644
--- a/gradle/hibernate5-test-config.gradle
+++ b/gradle/hibernate5-test-config.gradle
@@ -23,6 +23,11 @@ dependencies {
}
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'onlyFunctionalTests',
diff --git a/gradle/mongodb-forked-test-config.gradle b/gradle/mongodb-forked-test-config.gradle
index f2f2215914..609f38e6c5 100644
--- a/gradle/mongodb-forked-test-config.gradle
+++ b/gradle/mongodb-forked-test-config.gradle
@@ -27,6 +27,11 @@ tasks.named('compileTestGroovy', GroovyCompile) {
}
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'onlyFunctionalTests',
diff --git a/gradle/mongodb-test-config.gradle b/gradle/mongodb-test-config.gradle
index 09fcbf9c30..2e87718222 100644
--- a/gradle/mongodb-test-config.gradle
+++ b/gradle/mongodb-test-config.gradle
@@ -27,6 +27,11 @@ tasks.named('compileTestGroovy', GroovyCompile) {
}
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'onlyFunctionalTests',
diff --git a/gradle/test-config.gradle b/gradle/test-config.gradle
index 3e6c5f1c83..ae1a2b407b 100644
--- a/gradle/test-config.gradle
+++ b/gradle/test-config.gradle
@@ -43,8 +43,11 @@ tasks.withType(GroovyCompile).configureEach {
}
tasks.withType(Test).configureEach {
- // Disable build cache for tests in CI to ensure they always run
- outputs.cacheIf { !isCiBuild }
+ // Disable build cache for tests in CI to ensure they always run.
+ // Also honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test
+ // command without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !isCiBuild && !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
onlyIf {
![
diff --git a/grails-forge/build.gradle b/grails-forge/build.gradle
index e427bce710..6b610a1f57 100644
--- a/grails-forge/build.gradle
+++ b/grails-forge/build.gradle
@@ -38,6 +38,10 @@ ext {
DateTimeFormatter.ISO_DATE.format(LocalDate.ofInstant(buildInstant as Instant, ZoneOffset.UTC))
buildDate = (buildInstant as Instant).atZone(ZoneOffset.UTC) // for reproducible builds
isCiBuild = System.getenv().containsKey('CI')
+ // Set DO_NOT_CACHE_TESTS=1 to force test tasks to re-run on every invocation without
+ // needing --rerun-tasks. Useful for repeatedly running the same test command while
+ // chasing flaky tests across runs.
+ doNotCacheTests = System.getenv().get('DO_NOT_CACHE_TESTS') as Boolean
}
allprojects {
@@ -46,6 +50,11 @@ allprojects {
gradle.includedBuild('grails-core').task(':publishAllPublicationsToTestCaseMavenRepoRepository'),
gradle.includedBuild('grails-gradle').task(':publishAllPublicationsToTestCaseMavenRepoRepository')
)
+
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ testTask.outputs.cacheIf { !doNotCacheTests }
+ testTask.outputs.upToDateWhen { !doNotCacheTests }
}
}
diff --git a/grails-forge/gradle/test-config.gradle b/grails-forge/gradle/test-config.gradle
index cb3ea05b40..b59224aae5 100644
--- a/grails-forge/gradle/test-config.gradle
+++ b/grails-forge/gradle/test-config.gradle
@@ -25,6 +25,11 @@ dependencies {
}
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'skipTests'
diff --git a/grails-gradle/build.gradle b/grails-gradle/build.gradle
index f73da4d626..cd03b91615 100644
--- a/grails-gradle/build.gradle
+++ b/grails-gradle/build.gradle
@@ -42,6 +42,10 @@ ext {
isReleaseVersion = Boolean.parseBoolean(System.getenv('GRAILS_PUBLISH_RELEASE'))
isCiBuild = System.getenv().containsKey('CI')
+ // Set DO_NOT_CACHE_TESTS=1 to force test tasks to re-run on every invocation without
+ // needing --rerun-tasks. Useful for repeatedly running the same test command while
+ // chasing flaky tests across runs.
+ doNotCacheTests = System.getenv().get('DO_NOT_CACHE_TESTS') as Boolean
configuredTestParallel = findProperty('maxTestParallel') as Integer ?: (isCiBuild ? 3 : Runtime.runtime.availableProcessors() * 3/4 as int ?: 1)
}
diff --git a/grails-gradle/gradle/test-config.gradle b/grails-gradle/gradle/test-config.gradle
index 8f166e0097..03c03c5a49 100644
--- a/grails-gradle/gradle/test-config.gradle
+++ b/grails-gradle/gradle/test-config.gradle
@@ -27,6 +27,11 @@ def java17moduleReflectionCompatibilityArguments = [
]
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf {
![
'onlyFunctionalTests',
diff --git a/grails-test-suite-uber/build.gradle b/grails-test-suite-uber/build.gradle
index 4748427967..9c9246be46 100644
--- a/grails-test-suite-uber/build.gradle
+++ b/grails-test-suite-uber/build.gradle
@@ -132,6 +132,11 @@ tasks.named('isolatedTestsTwo', Test) {
}
tasks.withType(Test).configureEach {
+ // Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
+ // without --rerun-tasks (and without recompiling everything else).
+ outputs.cacheIf { !doNotCacheTests }
+ outputs.upToDateWhen { !doNotCacheTests }
+
onlyIf { !testSkippingProperties.any {project.hasProperty(it) } }
useJUnitPlatform()
maxParallelForks = configuredTestParallel