Skip to content

Commit

Permalink
Update micronaut core version (#1033)
Browse files Browse the repository at this point in the history
* Update micronaut core version
* Change tests to nor rely on logs removed by micronaut-projects/micronaut-core#10769
* Fix more tests
  • Loading branch information
andriy-dmytruk authored Sep 16, 2024
1 parent a5186d1 commit dfb1b6c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ENTRYPOINT ["java", "-jar", "/home/app/application.jar"]
COPY --link config-dirs/generateResourcesConfigFile /home/app/config-dirs/generateResourcesConfigFile
COPY --link config-dirs/io.netty/netty-common/4.0.0.Final /home/app/config-dirs/io.netty/netty-common/4.0.0.Final
COPY --link config-dirs/ch.qos.logback/logback-classic/4.0.0 /home/app/config-dirs/ch.qos.logback/logback-classic/4.0.0
RUN native-image --exclude-config .*/libs/netty-codec-http2-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-handler-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-buffer-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-common-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-transport-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-codec-http-4.0.0.Final.jar ^/META-INF/native-image/.* -cp /home/app/libs/*.jar:/home/app/resources:/home/app/application.jar --no-fallback -o application -H:ConfigurationFileDirectories=/home/app/config-dirs/generateResourcesConfigFile,/home/app/config-dirs/io.netty/netty-buffer/4.0.0.Final,/home/app/config-dirs/io.netty/netty-common/4.0.0.Final,/home/app/config-dirs/io.netty/netty-codec-http/4.0.0.Final,/home/app/config-dirs/io.netty/netty-transport/4.0.0.Final,/home/app/config-dirs/io.netty/netty-handler/4.0.0.Final,/home/app/config-dirs/io.netty/netty-codec-http2/4.0.0.Final,/home/app/config-dirs/ch.qos.logback/logback-classic/4.0.0 demo.app.Application
RUN native-image --exclude-config .*/libs/netty-codec-http-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-handler-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-codec-http2-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-common-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-transport-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-buffer-4.0.0.Final.jar ^/META-INF/native-image/.* -cp /home/app/libs/*.jar:/home/app/resources:/home/app/application.jar --no-fallback -o application -H:ConfigurationFileDirectories=/home/app/config-dirs/generateResourcesConfigFile,/home/app/config-dirs/io.netty/netty-buffer/4.0.0.Final,/home/app/config-dirs/io.netty/netty-common/4.0.0.Final,/home/app/config-dirs/io.netty/netty-codec-http/4.0.0.Final,/home/app/config-dirs/io.netty/netty-transport/4.0.0.Final,/home/app/config-dirs/io.netty/netty-handler/4.0.0.Final,/home/app/config-dirs/io.netty/netty-codec-http2/4.0.0.Final,/home/app/config-dirs/ch.qos.logback/logback-classic/4.0.0 demo.app.Application
FROM cgr.dev/chainguard/wolfi-base:latest
EXPOSE 8080
COPY --link --from=graalvm /home/app/application /app/application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ micronaut:
RUN mkdir -p /home/alternate/config-dirs/io.netty/netty-common/4.0.0.Final
COPY --link config-dirs/generateResourcesConfigFile /home/alternate/config-dirs/generateResourcesConfigFile
COPY --link config-dirs/io.netty/netty-common/4.0.0.Final /home/alternate/config-dirs/io.netty/netty-common/4.0.0.Final
RUN native-image --exclude-config .*/libs/netty-codec-http2-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-handler-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-buffer-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-common-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-transport-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-codec-http-4.0.0.Final.jar ^/META-INF/native-image/.* -cp /home/alternate/libs/*.jar:/home/alternate/resources:/home/alternate/application.jar --no-fallback -o application -H:ConfigurationFileDirectories=/home/alternate/config-dirs/generateResourcesConfigFile,/home/alternate/config-dirs/io.netty/netty-buffer/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-common/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-codec-http/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-transport/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-handler/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-codec-http2/4.0.0.Final example.Application
RUN native-image --exclude-config .*/libs/netty-codec-http-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-handler-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-codec-http2-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-common-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-transport-4.0.0.Final.jar ^/META-INF/native-image/.* --exclude-config .*/libs/netty-buffer-4.0.0.Final.jar ^/META-INF/native-image/.* -cp /home/alternate/libs/*.jar:/home/alternate/resources:/home/alternate/application.jar --no-fallback -o application -H:ConfigurationFileDirectories=/home/alternate/config-dirs/generateResourcesConfigFile,/home/alternate/config-dirs/io.netty/netty-buffer/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-common/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-codec-http/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-transport/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-handler/4.0.0.Final,/home/alternate/config-dirs/io.netty/netty-codec-http2/4.0.0.Final example.Application
FROM cgr.dev/chainguard/wolfi-base:latest
EXPOSE 8080
HEALTHCHECK CMD curl -s localhost:8090/health | grep '"status":"UP"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class Foo {}
println result.output
then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/tmp/kapt3/classes/main/example/$Foo$Definition.class').toFile().exists()

where:
plugin << ['library', 'minimal.library']
Expand Down Expand Up @@ -149,7 +150,8 @@ class Foo {}
println result.output
then:
result.task(":compileCustomKotlin").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/tmp/kapt3/classes/custom/example/$Foo$Definition.class').toFile().exists()

where:
plugin << ['library', 'minimal.library']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public class ExampleTest {
println result.output

then:
result.output.contains('Creating bean classes for 1 type elements')
task.outcome == TaskOutcome.SUCCESS
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$ExampleTest$Definition.class').toFile().exists()

where:
plugins << [
Expand Down Expand Up @@ -126,7 +127,6 @@ public class ExampleTest {
//
// def task = result.task(":test")
// then:
// result.output.contains('Creating bean classes for 1 type elements')
// task.outcome == TaskOutcome.SUCCESS
// }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class FooTest {

then:
result.task(":test").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$FooTest$Definition.class').toFile().exists()
}

def "test add jaxrs processing"() {
Expand Down Expand Up @@ -169,7 +170,6 @@ public class Foo {

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/main/example/$Foo$Definition.class'
Expand Down Expand Up @@ -219,7 +219,6 @@ public class Foo {

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/main/example/$Foo$Definition$Intercepted.class'
Expand Down Expand Up @@ -274,7 +273,6 @@ class Foo {}

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
result.output.contains("Generating OpenAPI Documentation")
new File(
testProjectDir.getRoot(),
Expand Down Expand Up @@ -316,7 +314,6 @@ class Foo {}

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/main/example/$Foo$Definition.class'
Expand Down Expand Up @@ -367,7 +364,6 @@ class Foo {}

then:
result.task(":compileCustomJava").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/custom/example/$Foo$Definition.class'
Expand Down Expand Up @@ -424,7 +420,8 @@ class Foo {

then:
result.task(":test").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$Foo$Definition.class').toFile().exists()
}

def "test custom sourceSets for micronaut-library and groovy"() {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ log4j2 = "2.23.1"
jetbrains-annotations = "24.1.0"
tomlj = "1.1.1"

micronaut-platform = "4.4.2" # This is the platform version, used in our tests
micronaut-platform = "4.6.0" # This is the platform version, used in our tests
micronaut-aot = "2.4.0"
micronaut-testresources = "2.5.4"
micronaut-openapi = "6.12.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class MicronautMinimalApplicationPluginSpec extends AbstractGradleBuildSpec {
println result.output

then:
result.output.contains('Creating bean classes for 1 type elements')
task.outcome == TaskOutcome.SUCCESS
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$ExampleTest$Definition.class').toFile().exists()

}

Expand Down Expand Up @@ -359,8 +360,8 @@ public class ExampleTest {
println result.output

then:
!result.output.contains('Creating bean classes for 1 type elements')
task.outcome == TaskOutcome.FAILED

!testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$ExampleTest$Definition.class').toFile().exists()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class FooTest {

then:
result.task(":test").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$FooTest$Definition.class').toFile().exists()
}

def "test add jaxrs processing"() {
Expand Down Expand Up @@ -169,7 +170,6 @@ public class Foo {

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/main/example/$Foo$Definition.class'
Expand Down Expand Up @@ -224,7 +224,6 @@ class Foo {}

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
result.output.contains("Generating OpenAPI Documentation")
new File(
testProjectDir.getRoot(),
Expand Down Expand Up @@ -266,7 +265,6 @@ class Foo {}

then:
result.task(":assemble").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/main/example/$Foo$Definition.class'
Expand Down Expand Up @@ -317,7 +315,6 @@ class Foo {}

then:
result.task(":compileCustomJava").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
new File(
testProjectDir.getRoot(),
'build/classes/java/custom/example/$Foo$Definition.class'
Expand Down Expand Up @@ -374,7 +371,8 @@ class Foo {

then:
result.task(":test").outcome == TaskOutcome.SUCCESS
result.output.contains("Creating bean classes for 1 type elements")
testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$Foo$Definition.class').toFile().exists()
}

def "test custom sourceSets for micronaut-library and groovy"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ micronaut = "$micronautVersion"
println result.output

then:
result.output.contains('Creating bean classes for 1 type elements')
task.outcome == TaskOutcome.SUCCESS

testProjectDir.root.toPath()
.resolve('build/classes/java/test/example/$ExampleTest$Definition.class').toFile().exists()
}


Expand Down

0 comments on commit dfb1b6c

Please sign in to comment.