grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.79k stars 949 forks source link

Grails 7: Finish Micronaut to Spring Conversion #13690

Open codeconsole opened 1 month ago

codeconsole commented 1 month ago

Full list of failing tests: https://github.com/grails/grails-core/pull/13702/files

There are parts of grails-core are not 100% working. These are identified by failing tests which need to be fixed.

DataBindingConfigurationSpec.groovy Ordering

RespondMethodSpec ContentFormatControllerTests CommandObjectNoDataSpec WithFormatContentTypeSpec GrailsWebDataBinderConfigurationSpec CommandObjectsSpec

|    +--- io.micronaut:micronaut-inject:4.5.3
|    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    +--- jakarta.inject:jakarta.inject-api:2.0.1
|    |    +--- jakarta.annotation:jakarta.annotation-api:2.1.1 -> 3.0.0
|    |    \--- io.micronaut:micronaut-core:4.5.3
|    |         \--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    +--- jakarta.inject:jakarta.inject-api:2.0.1
|    +--- io.micronaut.spring:micronaut-spring-context:5.7.0
|    |    +--- io.micronaut.cache:micronaut-cache-core:4.3.0
|    |    |    +--- io.projectreactor:reactor-core:3.5.11 -> 3.6.9
|    |    |    |    \--- org.reactivestreams:reactive-streams:1.0.4
|    |    |    +--- io.micronaut:micronaut-inject:4.4.0 -> 4.5.3 (*)
|    |    |    +--- io.micronaut:micronaut-aop:4.4.0 -> 4.5.3
|    |    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |    +--- io.micronaut:micronaut-inject:4.5.3 (*)
|    |    |    |    \--- io.micronaut:micronaut-core:4.5.3 (*)
|    |    |    +--- io.micronaut:micronaut-http:4.4.0 -> 4.5.3
|    |    |    |    +--- io.projectreactor:reactor-core:3.5.11 -> 3.6.9 (*)
|    |    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |    +--- io.micronaut:micronaut-context:4.5.3
|    |    |    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |    |    +--- io.micronaut:micronaut-inject:4.5.3 (*)
|    |    |    |    |    \--- io.micronaut:micronaut-aop:4.5.3 (*)
|    |    |    |    +--- io.micronaut:micronaut-core-reactive:4.5.3
|    |    |    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |    |    +--- io.micronaut:micronaut-core:4.5.3 (*)
|    |    |    |    |    \--- org.reactivestreams:reactive-streams:1.0.4
|    |    |    |    \--- io.micronaut:micronaut-context-propagation:4.5.3
|    |    |    |         +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |         +--- io.micronaut:micronaut-context:4.5.3 (*)
|    |    |    |         +--- io.micronaut:micronaut-inject:4.5.3 (*)
|    |    |    |         \--- io.micronaut:micronaut-aop:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-inject:4.5.0 -> 4.5.3 (*)
|    |    +--- io.micronaut:micronaut-aop:4.5.0 -> 4.5.3 (*)
|    |    +--- io.micronaut.spring:micronaut-spring:5.7.0
|    |    |    +--- io.micronaut:micronaut-core-processor:4.5.0
|    |    |    |    +--- io.micronaut:micronaut-core-reactive:4.5.0 -> 4.5.3 (*)
|    |    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    |    +--- io.micronaut:micronaut-inject:4.5.0 -> 4.5.3 (*)
|    |    |    |    +--- io.micronaut:micronaut-aop:4.5.0 -> 4.5.3 (*)
|    |    |    |    +--- org.ow2.asm:asm-tree:9.7
|    |    |    |    |    \--- org.ow2.asm:asm:9.7
|    |    |    |    +--- org.ow2.asm:asm:9.7
|    |    |    |    +--- org.ow2.asm:asm-commons:9.7
|    |    |    |    |    +--- org.ow2.asm:asm:9.7
|    |    |    |    |    \--- org.ow2.asm:asm-tree:9.7 (*)
|    |    |    |    \--- com.github.javaparser:javaparser-symbol-solver-core:3.25.10
|    |    |    |         \--- com.github.javaparser:javaparser-core:3.25.10
|    |    |    +--- io.micronaut:micronaut-inject:4.5.0 -> 4.5.3 (*)
|    |    |    +--- org.springframework:spring-framework-bom:6.1.8 (*)
|    |    |    +--- org.springframework:spring-core:6.1.8 -> 6.1.12 (*)
|    |    |    +--- org.springframework:spring-tx:6.1.8 -> 6.1.12
|    |    |    |    +--- org.springframework:spring-beans:6.1.12 (*)
|    |    |    |    \--- org.springframework:spring-core:6.1.12 (*)
|    |    |    +--- org.springframework:spring-context:6.1.8 -> 6.1.12 (*)
|    |    |    +--- io.micronaut:micronaut-aop:4.5.0 -> 4.5.3 (*)
|    |    |    \--- io.micronaut:micronaut-core-bom:4.5.0 (*)
|    |    \--- io.micronaut:micronaut-core-bom:4.5.0 (*)
|    +--- io.micronaut.cache:micronaut-cache-core:4.3.0 (*)
|    +--- io.micronaut:micronaut-runtime:4.5.3
|    |    +--- io.projectreactor:reactor-core:3.5.11 -> 3.6.9 (*)
|    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    +--- io.micronaut:micronaut-aop:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-discovery-core:4.5.3
|    |    |    +--- io.projectreactor:reactor-core:3.5.11 -> 3.6.9 (*)
|    |    |    +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |    |    \--- io.micronaut:micronaut-context:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-context:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-context-propagation:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-core-reactive:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-http:4.5.3 (*)
|    |    +--- io.micronaut:micronaut-inject:4.5.3 (*)
|    |    \--- io.micronaut:micronaut-retry:4.5.3
|    |         +--- io.projectreactor:reactor-core:3.5.11 -> 3.6.9 (*)
|    |         +--- org.slf4j:slf4j-api:2.0.13 -> 2.0.16
|    |         +--- io.micronaut:micronaut-context:4.5.3 (*)
|    |         \--- io.micronaut:micronaut-core-reactive:4.5.3 (*)
codeconsole commented 1 month ago

https://github.com/grails/grails-spring-security-core/pull/1021/commits/cfcdbd8cc5df5a6a9a672b89047249b43b49a03f

jamesfredley commented 1 month ago

For the org.grails.spring.context.support.PluginAwareResourceBundleMessageSource related errors, StaticMessageSource is the expected MessageSource type for testing which provides an addMessage method. The bean is set as StaticMessageSource here:

https://github.com/grails/grails-testing-support/blob/4.0.x/grails-testing-support/src/main/groovy/org/grails/testing/GrailsApplicationBuilder.groovy#L170-L189

messageSource(StaticMessageSource)

codeconsole commented 1 month ago

https://github.com/grails/grails-core/pull/13685

jamesfredley commented 1 month ago

https://github.com/grails/grails-testing-support/pull/431 fixes 28 of the ~52 new failing tests.

codeconsole commented 1 month ago

I just removed GrailsAutoConfiguration It was registering grailsApplicationPostProcessor after the test grailsApplicationPostProcessor so the TestRuntimeGrailsApplicationPostProcessor was being ignored because it had the same name.

https://github.com/grails/grails-testing-support/pull/435

I am only seeing 9 failing tests? https://github.com/grails/grails-core/actions/runs/11079311377/job/30823450376

jamesfredley commented 1 month ago

That made an massive difference. Down to 3 distinct test failures on https://github.com/grails/grails-core/pull/13702/files, these each get run 3 times on https://github.com/grails/grails-core/actions/runs/11079311377/job/30823450376

jamesfredley commented 1 month ago

The remaining 3 new failing tests:

https://github.com/grails/grails-core/pull/13702/files#diff-6889bb937b05f118cd7a9dc1f21e76edb66bbd53ea8901923d90c284f7f2c4b5

https://github.com/grails/grails-core/pull/13702/files#diff-d7674e06b1294ce8a4fae2ab1606c48dbd1ff7c1eddb037dfd868dcc59f8fa7e