Support parallel initialization of Testcontainers
Add support for a `spring.testcontainers.startup` property that can be set to "sequential" or "parallel" to change how containers are started. Closes gh-37073
This commit is contained in:
@@ -61,6 +61,7 @@ dependencies {
|
||||
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-autoconfigure"))
|
||||
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-devtools"))
|
||||
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-docker-compose"))
|
||||
asciidoctorExtensions(project(path: ":spring-boot-project:spring-boot-testcontainers"))
|
||||
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure", configuration: "autoConfigurationMetadata"))
|
||||
@@ -74,6 +75,7 @@ dependencies {
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))
|
||||
|
||||
gradlePluginDocumentation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "documentation"))
|
||||
|
||||
|
||||
@@ -47,4 +47,6 @@ include::application-properties/devtools.adoc[]
|
||||
|
||||
include::application-properties/docker-compose.adoc[]
|
||||
|
||||
include::application-properties/testcontainers.adoc[]
|
||||
|
||||
include::application-properties/testing.adoc[]
|
||||
|
||||
@@ -1072,6 +1072,9 @@ include::code:test/MyContainersConfiguration[]
|
||||
NOTE: The lifecycle of `Container` beans is automatically managed by Spring Boot.
|
||||
Containers will be started and stopped automatically.
|
||||
|
||||
TIP: You can use the configprop:spring.testcontainers.startup[] property to change how containers are started.
|
||||
By default `sequential` startup is used, but you may also choose `parallel` if you wish to start multiple containers in parallel.
|
||||
|
||||
Once you have defined your test configuration, you can use the `with(...)` method to attach it to your test launcher:
|
||||
|
||||
include::code:test/TestMyApplication[]
|
||||
|
||||
Reference in New Issue
Block a user