From 133f79b0aacf9483d338050bd82e9b565aab4686 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Oct 2024 12:18:03 +0200 Subject: [PATCH 1/5] build: Remove `mavenLocal()` repository This commit removes the `mavenLocal()` repository from the build but makes it ready to be used by the `groovy-joint-workflow` later. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a1804d7b..1fe1124b 100644 --- a/build.gradle +++ b/build.gradle @@ -30,9 +30,9 @@ if(isReleaseVersion) { subprojects { version = rootProject.version repositories { - mavenLocal() // Used by Groovy Joint Workflow mavenCentral() maven { url = 'https://repo.grails.org/grails/core' } + // mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow) if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) { maven { name = 'JFrog Groovy snapshot repo' From d7253ae22897850e6c556732c64e25793856b17b Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Oct 2024 12:18:44 +0200 Subject: [PATCH 2/5] fix(deps): Fix test dependencies --- gradle/libs.versions.toml | 3 +++ grails-plugin-async/build.gradle | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c2f484b5..5093f632 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,6 +15,7 @@ rxjava2 = '2.2.21' slf4j = '1.7.36' spock = '2.3-groovy-4.0' spring = '6.1.13' +tomcat = '10.1.31' [libraries] bytebuddy = { module = 'net.bytebuddy:byte-buddy', version.ref = 'bytebuddy' } @@ -39,9 +40,11 @@ spock-core = { module = 'org.spockframework:spock-core', version.ref = 'spock' } spring-beans = { module = 'org.springframework:spring-beans', version.ref = 'spring' } spring-core = { module = 'org.springframework:spring-core', version.ref = 'spring' } spring-context = { module = 'org.springframework:spring-context', version.ref = 'spring' } +spring-test = { module = 'org.springframework:spring-test', version.ref = 'spring' } spring-tx = { module = 'org.springframework:spring-tx', version.ref = 'spring' } spring-web = { module = 'org.springframework:spring-web', version.ref = 'spring' } micronaut-serde-jackson = { module = 'io.micronaut.serde:micronaut-serde-jackson', version.ref = 'micronaut-serde-jackson' } micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut-http-client' } grails-views-json = { module = 'org.grails.plugins:views-json', version.ref = 'grails-views' } grails-views-json-templates = { module = 'org.grails.plugins:views-json-templates', version.ref = 'grails-views' } +tomcat-servletApi = { module = 'org.apache.tomcat:tomcat-servlet-api', version.ref = 'tomcat' } \ No newline at end of file diff --git a/grails-plugin-async/build.gradle b/grails-plugin-async/build.gradle index 8f9fc74b..74b55d89 100644 --- a/grails-plugin-async/build.gradle +++ b/grails-plugin-async/build.gradle @@ -29,7 +29,10 @@ dependencies { testImplementation libs.spock.core testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.spring.test + testRuntimeOnly libs.tomcat.servletApi + testCompileOnly libs.spring.test } apply from: rootProject.layout.projectDirectory.file('gradle/grails-plugin-config.gradle') From 309e3e07e83f1ec71e3bb005a76727d3090ad999 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Oct 2024 13:11:23 +0200 Subject: [PATCH 3/5] test: Fix test logging --- gradle/libs.versions.toml | 4 ++-- grails-async-core/build.gradle | 2 +- grails-async-gpars/build.gradle | 2 +- grails-async-rxjava/build.gradle | 2 +- grails-async-rxjava2/build.gradle | 2 +- grails-events-core/build.gradle | 2 +- grails-events-rxjava/build.gradle | 2 +- grails-events-rxjava2/build.gradle | 2 +- grails-events-spring/build.gradle | 2 +- grails-events-transform/build.gradle | 2 +- grails-plugin-async/build.gradle | 2 +- grails-plugin-events/build.gradle | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5093f632..5be6a05c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,7 +12,7 @@ micronaut-serde-jackson = '2.10.2' objenesis = '3.3' rxjava = '1.3.8' rxjava2 = '2.2.21' -slf4j = '1.7.36' +slf4j = '2.0.16' spock = '2.3-groovy-4.0' spring = '6.1.13' tomcat = '10.1.31' @@ -34,7 +34,7 @@ objenesis = { module = 'org.objenesis:objenesis', version.ref = 'objenesis' } rxjava = { module = 'io.reactivex:rxjava', version.ref = 'rxjava' } rxjava2 = { module = 'io.reactivex.rxjava2:rxjava', version.ref = 'rxjava2' } slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j' } -slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j' } +slf4j-simple = { module = 'org.slf4j:slf4j-simple', version.ref = 'slf4j' } servlet-api = { module = 'javax.servlet:javax.servlet-api', version = '4.0.1' } spock-core = { module = 'org.spockframework:spock-core', version.ref = 'spock' } spring-beans = { module = 'org.springframework:spring-beans', version.ref = 'spring' } diff --git a/grails-async-core/build.gradle b/grails-async-core/build.gradle index ca3f35af..c451144c 100644 --- a/grails-async-core/build.gradle +++ b/grails-async-core/build.gradle @@ -20,7 +20,7 @@ dependencies { testRuntimeOnly libs.bytebuddy testRuntimeOnly libs.objenesis - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-async-gpars/build.gradle b/grails-async-gpars/build.gradle index 93eed4df..09fa933c 100644 --- a/grails-async-gpars/build.gradle +++ b/grails-async-gpars/build.gradle @@ -20,7 +20,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-async-rxjava/build.gradle b/grails-async-rxjava/build.gradle index d0c07413..42e60490 100644 --- a/grails-async-rxjava/build.gradle +++ b/grails-async-rxjava/build.gradle @@ -17,7 +17,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle') diff --git a/grails-async-rxjava2/build.gradle b/grails-async-rxjava2/build.gradle index 4b4edb8d..3434efbf 100644 --- a/grails-async-rxjava2/build.gradle +++ b/grails-async-rxjava2/build.gradle @@ -17,7 +17,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-events-core/build.gradle b/grails-events-core/build.gradle index c627ae20..b301ea1d 100644 --- a/grails-events-core/build.gradle +++ b/grails-events-core/build.gradle @@ -17,7 +17,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-events-rxjava/build.gradle b/grails-events-rxjava/build.gradle index fdcdb600..3e263090 100644 --- a/grails-events-rxjava/build.gradle +++ b/grails-events-rxjava/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation libs.spock.core testImplementation libs.spring.context - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-events-rxjava2/build.gradle b/grails-events-rxjava2/build.gradle index ed93b1eb..95931778 100644 --- a/grails-events-rxjava2/build.gradle +++ b/grails-events-rxjava2/build.gradle @@ -17,7 +17,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-events-spring/build.gradle b/grails-events-spring/build.gradle index b2e97aa8..8bd52dec 100644 --- a/grails-events-spring/build.gradle +++ b/grails-events-spring/build.gradle @@ -17,7 +17,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-events-transform/build.gradle b/grails-events-transform/build.gradle index 61e9a6db..6e5481f5 100644 --- a/grails-events-transform/build.gradle +++ b/grails-events-transform/build.gradle @@ -30,7 +30,7 @@ dependencies { } testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle') diff --git a/grails-plugin-async/build.gradle b/grails-plugin-async/build.gradle index 74b55d89..88f971bd 100644 --- a/grails-plugin-async/build.gradle +++ b/grails-plugin-async/build.gradle @@ -28,7 +28,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task testRuntimeOnly libs.spring.test testRuntimeOnly libs.tomcat.servletApi diff --git a/grails-plugin-events/build.gradle b/grails-plugin-events/build.gradle index 31718ec4..99e9d4a9 100644 --- a/grails-plugin-events/build.gradle +++ b/grails-plugin-events/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation libs.spock.core - testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task + testRuntimeOnly libs.slf4j.simple // Get rid of warning about missing slf4j implementation during test task } From e6a3d2b525804b71730b55e0261172d150216f9f Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Oct 2024 13:19:48 +0200 Subject: [PATCH 4/5] test: cleanup --- .../groovy/grails/async/FutureTaskPromiseFactorySpec.groovy | 2 +- .../grails/async/factory/rxjava/RxJavaPromiseListSpec.groovy | 5 +---- .../grails/async/factory/rxjava2/RxPromiseListSpec.groovy | 5 +---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/grails-async-core/src/test/groovy/grails/async/FutureTaskPromiseFactorySpec.groovy b/grails-async-core/src/test/groovy/grails/async/FutureTaskPromiseFactorySpec.groovy index 48d0c6d9..5d06bba8 100644 --- a/grails-async-core/src/test/groovy/grails/async/FutureTaskPromiseFactorySpec.groovy +++ b/grails-async-core/src/test/groovy/grails/async/FutureTaskPromiseFactorySpec.groovy @@ -113,7 +113,7 @@ class FutureTaskPromiseFactorySpec extends Specification { when: 'a promise is chained' def promise = Promises.createPromise { 1 + 1 } - promise = promise.then { it * 2 } then { throw new RuntimeException('bad') } then { it + 6 } + promise = promise.then { it * 2 } then { throw new RuntimeException('explicitly forced exception') } then { it + 6 } def val = promise.get() then: 'the chain is executed' diff --git a/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseListSpec.groovy b/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseListSpec.groovy index 273df16e..b6b114ef 100644 --- a/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseListSpec.groovy +++ b/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseListSpec.groovy @@ -49,10 +49,7 @@ class RxJavaPromiseListSpec extends Specification{ list << { 1 } def promise = list .then { it << 2; it } - .then { - Thread.dumpStack() - it << 3; it - } + .then { it << 3; it } def result = promise.get() then: 'an appropriately populated list is produced' diff --git a/grails-async-rxjava2/src/test/groovy/org/grails/async/factory/rxjava2/RxPromiseListSpec.groovy b/grails-async-rxjava2/src/test/groovy/org/grails/async/factory/rxjava2/RxPromiseListSpec.groovy index 78f97eb8..5c73b5d7 100644 --- a/grails-async-rxjava2/src/test/groovy/org/grails/async/factory/rxjava2/RxPromiseListSpec.groovy +++ b/grails-async-rxjava2/src/test/groovy/org/grails/async/factory/rxjava2/RxPromiseListSpec.groovy @@ -48,10 +48,7 @@ class RxPromiseListSpec extends Specification { list << { 1 } def promise = list .then { it << 2; it } - .then { - Thread.dumpStack() - it << 3; it - } + .then { it << 3; it } def result = promise.get() then: 'An appropriately populated list is produced' From 99afcfcfa27b4d1552f5c5c67c52989d1eed17a4 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Oct 2024 13:28:48 +0200 Subject: [PATCH 5/5] test: Replace deprecated logback conversionRule attribute [converterClass] attribute is deprecated and replaced by [class]. --- .../src/integration-test/resources/logback-test.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pubsub-demo/src/integration-test/resources/logback-test.xml b/examples/pubsub-demo/src/integration-test/resources/logback-test.xml index a163180e..6031844f 100644 --- a/examples/pubsub-demo/src/integration-test/resources/logback-test.xml +++ b/examples/pubsub-demo/src/integration-test/resources/logback-test.xml @@ -1,8 +1,8 @@ - - + + true