You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although Quarkus can generate an AOT cache file without ever running the production application, the file will not be optimal as the application was never exercised against any load. To alleviate this,
122
+
Quarkus can use the existing testsuite of tests annotated with `@QuarkusIntegrationTest` to create an AOT cache file.
123
+
See the xref:getting-started-testing.adoc#generating-an-aot-cache-during-integration-tests[corresponding section] in the Testing Guide for more details.
124
+
125
+
119
126
=== Usage in containers
120
127
121
128
When building container images using the `quarkus-container-image-jib` extension, Quarkus automatically takes care of all the steps needed to generate the archive and make it usable at runtime in the container.
=== Generating an AOT cache during integration tests
1359
+
1360
+
When targeting JDK 25+, you can instruct Quarkus to generate an AOT cache (`app.aot`) while running `@QuarkusIntegrationTest` tests.
1361
+
Enable this by adding the following system property to your integration test run:
1362
+
1363
+
[source,bash]
1364
+
----
1365
+
-Dquarkus.package.jar.appcds.use-aot=true
1366
+
----
1367
+
1368
+
With this flag, the tested application is launched with the JVM’s AOT cache output option, and an `app.aot` file is produced next to the built jar (for example `target/quarkus-app/app.aot`). You can then run the application with:
1369
+
1370
+
[source,bash]
1371
+
----
1372
+
java -XX:AOTCache=app.aot -jar quarkus-run.jar
1373
+
----
1374
+
1375
+
This feature essentially turns the existing testsuite into a training run.
1376
+
1377
+
[NOTE]
1378
+
====
1379
+
- The feature requires JDK 25 or newer.
1380
+
- The effectiveness of the generated cache depends on how representative your integration tests are of production startup and early traffic.
1381
+
====
1382
+
1357
1383
=== Launching containers
1358
1384
1359
1385
When `@QuarkusIntegrationTest` results in launching a container (because the application was built with `quarkus.container-image.build` set to `true`), the container is launched on a predictable container network. This facilitates writing integration tests that need to launch services to support the application.
@@ -1496,13 +1522,13 @@ You can use this tag to isolate the `@QuarkusTest` test in a specific execution
1496
1522
1497
1523
[NOTE]
1498
1524
--
1499
-
Currently `@QuarkusTest` and `@QuarkusIntegrationTest` should not be run in the same test run.
1525
+
Currently `@QuarkusTest` and `@QuarkusIntegrationTest` should not be run in the same test run.
1500
1526
1501
1527
For Maven, this means that the former should be run by the surefire plugin while the latter should be run by the failsafe plugin.
1502
1528
1503
1529
For Gradle, this means the two types of tests should belong to different source sets.
0 commit comments