Commit Graph

221 Commits

Author SHA1 Message Date
Andy Wilkinson 491f34d25c Improve container test code
Replace `DockerImageNames` with a enum and relocate it from the
`testcontainers` to `container` package. The enum now also
becomes a common location that we can use to apply container
configuration such as timeouts.

Closes gh-41164

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2024-06-19 20:10:03 -07:00
Scott Frederick 7d96789869 Fix Bitnami MongoDB environment variables for Docker Compose
Fixes gh-41097
2024-06-13 15:20:36 -05:00
Phillip Webb 147240aa0c Merge branch '3.2.x'
Closes gh-41080
2024-06-11 13:32:30 -07:00
Phillip Webb bcbcafaab2 Polish "Use method references when possible in test code"
See gh-40974
2024-06-11 12:58:04 -07:00
Ahmed Ashour 207327d97c Use method references when possible in test code
See gh-40974
2024-06-11 12:58:00 -07:00
Johnny Lim 3c76f81fe3 Polish
See gh-40449
2024-04-22 12:27:49 +01:00
Moritz Halbritter 6d192e62fd Add property to control Docker Compose start command execution
If the property 'spring.docker.compose.start.skip' is set to 'never',
the start command is always executed. The default value of 'if-running'
only executes the start command if there are no services running
already, which is the old behavior.

Closes gh-39749
2024-04-05 08:36:28 +02:00
Moritz Halbritter 3ab21ce146 Merge branch '3.2.x'
Closes gh-40118
2024-03-27 09:42:59 +01:00
Moritz Halbritter 957facf1cc Merge branch '3.1.x' into 3.2.x
Closes gh-40117
2024-03-27 09:35:44 +01:00
Moritz Halbritter e6a0202f55 Disable test on AARCH64 2024-02-28 17:59:47 +01:00
Phillip Webb f8a1dae835 Merge branch '3.2.x' 2024-02-21 15:27:57 -08:00
Phillip Webb 12de6aa46a Merge branch '3.1.x' into 3.2.x 2024-02-21 15:27:27 -08:00
Phillip Webb 2c4909a89a Update copyright year of changed files 2024-02-21 13:58:53 -08:00
Scott Frederick bb384f268e Merge branch '3.2.x'
Closes gh-39639
2024-02-20 10:34:54 -06:00
Scott Frederick 71e5e1252a Merge branch '3.1.x' into 3.2.x
Closes gh-39638
2024-02-20 10:34:32 -06:00
Scott Frederick c93acdafbd Polish "Prevent long parse times for images with illegal char in tag"
See gh-39617
2024-02-20 10:27:28 -06:00
Jakob Wanger c892544741 Prevent long parse times for images with illegal char in tag
Update the regular expression used to parse Docker images references to
prevent catastrophic backtracking when images names are long and the
tag contains an illegal character.

See gh-39617
2024-02-20 10:27:27 -06:00
Moritz Halbritter 7f55cae90f Merge branch '3.2.x' 2024-02-12 10:19:46 +01:00
Moritz Halbritter 4387b79831 Merge branch '3.1.x' into 3.2.x 2024-02-12 10:18:46 +01:00
Moritz Halbritter 8ffcfc9b77 Harmonize style of igored exceptions across the codebase 2024-02-12 10:14:20 +01:00
Scott Frederick 09a6ae51cc Add support for Bitnami container images with Docker Compose
Closes gh-35759
2024-02-09 14:58:25 -06:00
Eddú Meléndez f3e7325064 Add service connection for Docker Compose and Testcontainers ActiveMQ
See gh-39363
2024-02-02 09:05:37 +01:00
Moritz Halbritter 1f321c4421 Polish "Add service connection for Docker Compose and Testcontainers Artemis"
See gh-39311
2024-01-31 08:37:03 +01:00
Eddú Meléndez f15cd93a35 Add service connection for Docker Compose and Testcontainers Artemis
See gh-39311
2024-01-31 08:37:03 +01:00
Moritz Halbritter cd9b51d02c Merge branch '3.2.x'
Closes gh-39335
2024-01-30 13:35:20 +01:00
Eddú Meléndez 1247f89209 Polish
See gh-39312
2024-01-30 13:34:40 +01:00
Scott Frederick bee6fe899c Polish "Add Docker Compose service connection support for OpenLDAP"
See gh-39258
2024-01-22 16:51:45 -06:00
PhilKes eb940c3907 Add Docker Compose service connection support for OpenLDAP
See gh-39258
2024-01-22 16:51:45 -06:00
Moritz Halbritter de70b4fb4c Merge branch '3.1.x'
Closes gh-38661
2023-12-05 14:02:52 +01:00
Moritz Halbritter 3f29c7f84f Add log message if Docker Compose services are already running
Closes gh-38398
2023-12-05 14:02:16 +01:00
Andy Wilkinson a7571cf667 Use different default database names for Oracle XE and Oracle Free
Closes gh-38476
2023-11-22 10:48:35 +00:00
Phillip Webb 6c3dec42e0 Add container support for Oracle Free which replaces Oracle XE
Update Docker Compose and Testcontainers support to work with
`gvenzl/oracle-free` which replaces `gvenzl/oracle-xe`.

Closes gh-38476
2023-11-21 11:51:59 -08:00
Moritz Halbritter 9fc3ef7c93 Merge branch '3.1.x'
Closes gh-38220
2023-11-06 08:45:06 +01:00
Moritz Halbritter 7829e760da Switch JsonMapper in Docker JSON parsing to english locale
Closes gh-37648
2023-11-06 08:41:10 +01:00
Moritz Halbritter bdc5c05a83 Merge branch '3.1.x'
Closes gh-38145
2023-10-31 11:21:56 +01:00
Moritz Halbritter de1ca5e60f Polish DockerComposeLifecycleManager 2023-10-31 11:18:39 +01:00
Moritz Halbritter b11d06deb1 Merge branch '3.1.x'
Closes gh-37991
2023-10-23 10:42:42 +02:00
Moritz Halbritter 09821feb75 Fix container inspection for Docker Compose >= 2.23.0
Docker Compose starting with 2.23.0 returns truncated ids in the
docker compose ps call. We now do a prefix search if an exact match
isn't found in the docker inspect response.

Closes gh-37982
2023-10-23 10:40:20 +02:00
Johnny Lim 446677375e Polish gh-35082
See gh-37831
2023-10-12 14:17:02 +02:00
Andy Wilkinson 7d40a45b50 Merge branch '3.1.x'
Closes gh-37662
2023-10-03 11:21:29 +01:00
Andy Wilkinson a4100e12ff Merge branch '3.0.x' into 3.1.x
Closes gh-37661
2023-10-03 11:05:51 +01:00
Scott Frederick 619a0f3b35 Merge branch '3.1.x'
Closes gh-37624
2023-09-28 16:32:45 -05:00
JinseongHwang 0b703f9007 Use consistent capitalization in MySQL and MariaDB test names
See gh-37497
2023-09-28 16:28:32 -05:00
Andy Wilkinson e3d884803e Add Docker Compose support for Neo4j
Closes gh-37379
2023-09-14 13:25:38 +01:00
Moritz Halbritter f94693a251 Merge branch '3.1.x' 2023-09-14 11:29:18 +02:00
Moritz Halbritter fdd9bc732f Enable RabbitEnvironmentTests 2023-09-14 11:25:20 +02:00
Moritz Halbritter 136a5b4c07 Enable PostgresEnvironmentTests 2023-09-14 11:25:06 +02:00
Moritz Halbritter 496b373fce Remove unused test 2023-09-14 11:22:54 +02:00
Moritz Halbritter 0f019b0049 Reign in Cassandra memory consumption when running tests
The environment variables are the same as the Cassandra Testcontainers
uses.
2023-09-14 11:20:22 +02:00
Moritz Halbritter 3dd6372602 Polish "Add service connection from OpenTelemetry Collector"
See gh-35082
2023-09-14 11:10:19 +02:00
Moritz Halbritter c387c87fda Polish "Add service connection from OpenTelemetry Collector"
See gh-35082
2023-09-14 10:50:36 +02:00
Eddú Meléndez 6997277f75 Add service connection from OpenTelemetry Collector
See gh-35082
2023-09-14 09:44:20 +02:00
Phillip Webb 750c597225 Polish 'Add Pulsar ConnectionDetails support'
See gh-37197
2023-09-06 12:18:09 -07:00
Chris Bono 089fef0392 Add Pulsar ConnectionDetails support
Add `ConnectionDetails` support for Apache Pulsar and provide adapters
for Docker Compose and Testcontainers.

See gh-37197
2023-09-06 12:12:25 -07:00
Stephane Nicoll ad820cc99d Merge branch '3.1.x' 2023-08-22 12:52:25 +02:00
Stephane Nicoll 44847d6600 Fix assertion (sorry)
See gh-37044
2023-08-22 12:51:33 +02:00
Stephane Nicoll 15f14a6082 Merge branch '3.1.x' 2023-08-22 11:59:50 +02:00
Stephane Nicoll 621db533dc Fix assertion
See gh-37044
2023-08-22 11:58:38 +02:00
Stephane Nicoll 65ec6897e9 Merge branch '3.1.x'
Closes gh-37064
2023-08-22 10:49:37 +02:00
Stephane Nicoll 5a25c31832 Polish "Fix password property for Oracle container"
See gh-37044
2023-08-22 10:48:39 +02:00
Joe Steel ab1e521388 Fix password property for Oracle container
See gh-37044
2023-08-22 10:40:52 +02:00
Phillip Webb d73d8f8e4f Merge branch '3.1.x' 2023-08-13 19:15:56 -07:00
Phillip Webb 155300525e Polish 2023-08-13 19:15:38 -07:00
Phillip Webb 2fdc29b885 Revert "Polish"
This reverts commit 6a65ca13ea since
FileCopyUtils will close the reader/writer.
2023-08-13 19:00:04 -07:00
Moritz Halbritter 08ff1c2003 Merge branch '3.1.x' 2023-08-10 14:55:00 +02:00
Moritz Halbritter 6a65ca13ea Polish 2023-08-10 14:54:45 +02:00
Moritz Halbritter f54d370fcd Remove unused class 2023-08-10 14:54:45 +02:00
Moritz Halbritter 3bb93b37ca Remove --detach and --wait flags from docker compose start command
Closes gh-36908
2023-08-10 14:54:45 +02:00
Moritz Halbritter 784488b090 Merge branch '3.1.x'
Closes gh-36910
2023-08-10 12:21:26 +02:00
Moritz Halbritter d48aa806c2 Remove --no-color flag from docker compose start command
Closes gh-36908
2023-08-10 12:12:47 +02:00
Moritz Halbritter 7bb337aeb1 Polish tests 2023-08-08 13:12:47 +02:00
Scott Frederick 2452958f7b Merge branch '3.1.x'
Closes gh-36486
2023-07-24 15:10:48 -05:00
Scott Frederick bf08cc25df Use DockerImageNames in Docker compose integration tests
Closes gh-36485
2023-07-24 11:00:20 -05:00
Stephane Nicoll 311fa6272d Polish "Add service connection for Testcontainers ActiveMQ"
This also adds support for Docker Compose.

See gh-35080
2023-07-20 13:03:41 +02:00
Johnny Lim e97c5a7118 Use kebab-case for property default values in metadata
See gh-36170
2023-07-04 15:20:42 +01:00
Andy Wilkinson 3ef1738a5e Remove containers after use in Docker Compose integration tests
Closes gh-36104
2023-06-28 14:12:39 +01:00
Andy Wilkinson 660dbb9afd Fix Maven-built native images with Docker Compose dependency
Previously, we tried to prevent spring-boot-docker-compose from
causing problems with AOT and native images by excluding it from
the AOT processing classpath. This allowed AOT processing to
succeed. We cannot apply the same exclusion to the native image
classpath so spring-boot-docker-compose was still included in the
native image. This results in a failure at runtime due to missing
reflection hints.

This commit reverts that changes that excluded
spring-boot-docker-compose from the AOT processing classpath. This
allows AOT processing to generate reflection hints but reintroduces
the failure caused by the connection details bean definitions using
an instance supplier callback. To overcome this problem we disable
DockerComposeLifecycleManager during AOT processing and in a native
image. This ensures that no attempt is made to call docker compose up
and no connection details beans are defined.

Fixes gh-35676
2023-06-21 11:44:30 +01:00
Scott Frederick 8f31a5772e Set authSource in MongoDB Docker Compose connection details
When authentication credentials are provided in environment variables
for the official MongoDB Docker image, the authentication source must
also be set to the `admin` database.

Fixes gh-35777
2023-06-08 16:20:57 -05:00
Moritz Halbritter 157b71b333 Add missing defaults for docker compose properties
Closes gh-35598
2023-05-23 10:53:15 +02:00
Scott Frederick 0ca3ab7249 Polish Javadoc
See gh-35545
2023-05-19 14:20:14 -05:00
Andy Wilkinson 6ad71c9b0c Reduce number of CLI calls to improve startup time with devtools
Update `DockerComposeLifecycleManager` so that `docker ps` is
not called multiple times.

See gh-35435
2023-05-17 16:27:00 -07:00
Phillip Webb b0c76c1f79 Cache docker commands to improve startup time with devtools
Update `DockerCli` so that the docker commands are cached. This helps
improve startup time when using devtools with docker compose.

See gh-35435
2023-05-17 16:27:00 -07:00
Phillip Webb a8602a1814 Allow docker compose service readiness checks to be bypassed
Add `spring.docker.compose.readiness.wait` property that can be used to
determine how Spring Boot should wait for docker compose services to
become ready.

Fixes gh-35545
2023-05-17 16:27:00 -07:00
Phillip Webb 6b0b6ccf49 Move docker compose readiness code and make it package-private
The `ReadinessCheck` interface has been removed making the dedicated
package less necessary. By relocating the code we can make more of it
pacakge-private.

See gh-35544
2023-05-17 16:26:59 -07:00
Phillip Webb 060581d078 Remove pluggable docker compose ReadinessCheck
Remove pluggable `ReadinessCheck` interface and only use the
`TcpConnectServiceReadinessCheck` implementation for now. We
may re-introduce pluggable checks in a future version.

See gh-35544
2023-05-17 16:26:59 -07:00
Andy Wilkinson 3d41e41b94 Polish
Make logger a static field.
2023-05-17 16:26:59 -07:00
Johnny Lim 54f85b1181 Fix since version for ImageReference
See gh-35459
2023-05-17 16:02:32 -05:00
Phillip Webb ae90add7c7 Polish 2023-05-16 14:04:48 -07:00
Scott Frederick 8377306668 Improve error when Docker Compose file not found
Fixes gh-35383
2023-05-10 13:26:59 -05:00
Moritz Halbritter 441ed30ee4 Polish "Replace Mockito argument captors with assertArg"
Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>

See gh-35015
2023-05-05 15:41:31 +02:00
Andy Wilkinson 4f9616c2f9 Change DockerComposeProperties shut down default to stop
Closes gh-35239
2023-05-04 21:09:16 +01:00
Andy Wilkinson 6a39b497ad Make Oracle Docker Compose integration tests more robust
Closes gh-35285
2023-05-04 19:40:29 +01:00
Phillip Webb a890323758 Merge branch '3.0.x' 2023-05-02 14:52:42 -07:00
Moritz Halbritter 9a545727b9 Disable SQL server and Oracle database compose tests on ARM
See gh-35229
2023-05-02 14:16:56 +02:00
Andy Wilkinson 8fe20c5d63 Derive LiquibaseConnectionDetails from JdbcConnectionDetails
Closes gh-35141
2023-05-01 13:32:44 +01:00
Andy Wilkinson d293df6617 Derive FlywayConnectionDetails from JdbcConnectionDetails
Rather than implementing factories for FlywayConnectionDetails for
each supported SQL database, we instead use a factory to takes
JdbcConnectionDetails as a source and produces
FlywayConnectionDetails.

Closes gh-35138
2023-05-01 13:29:42 +01:00
Phillip Webb 403481ff96 Add 'required' parameter to ConnectionDetailsFactories
Update `ConnectionDetailsFactories` so that callers can now declare if
a result is required or not and improve exception hierarchy.

See gh-35168
2023-04-29 21:10:07 -07:00
Andy Wilkinson a75f55aaa5 Try to stabilize SQL Server tests on CI 2023-04-28 14:07:50 +01:00
Moritz Halbritter 4131e7338d Fix LogMessage format 2023-04-28 13:46:57 +02:00
Moritz Halbritter 75207db6be Polish docker compose code 2023-04-28 13:46:57 +02:00
Moritz Halbritter 8abebd75fb Use shutdownHandlers parameter in constructor 2023-04-28 13:46:56 +02:00
Andy Wilkinson cec159110d Do not block indefinitely when querying SQL database 2023-04-28 09:52:27 +01:00
Andy Wilkinson 8bbe894665 Add Docker Compose service connection support for Oracle using JDBC
Closes gh-35145
2023-04-27 11:07:53 +01:00
Andy Wilkinson 5e73047164 Align SQL Server-related class names with existing precedents
Closes gh-35181
2023-04-27 10:33:25 +01:00
Andy Wilkinson 1e785e81f8 Add Docker Compose support for Oracle Database using R2DBC
Closes gh-35143
2023-04-27 10:33:25 +01:00
Andy Wilkinson 8fd36d04e1 Improve MsSqlServerR2dbcDockerComposeConnectionDetailsFactory tests
See gh-35144
2023-04-27 09:31:25 +01:00
Andy Wilkinson b5178afa21 Add Docker Compose support for MS SQL Server using JDBC
Closes gh-35146
2023-04-27 09:31:24 +01:00
Scott Frederick e9a85b91a8 Polish 2023-04-25 16:20:38 -05:00
Scott Frederick 43b42eca49 Add Docker Compose service connection support for Cassandra
Closes gh-35136
2023-04-25 16:06:34 -05:00
Scott Frederick 2bec82ab2f Delete disabled docker compose tests 2023-04-25 14:51:04 -05:00
Andy Wilkinson fd6214e7e3 Remove accidentally committed test classes 2023-04-25 08:31:26 +01:00
Andy Wilkinson dee5217cf0 Add Docker Compose support for MS SQL Server using R2DBC
Closes gh-35144
2023-04-24 16:47:58 -07:00
Phillip Webb 0f032c290a Allow for predicate based checking of image names
Update `DockerComposeConnectionDetailsFactory` to accept a `Predicate`
based check to determine if the source should be accepted.

The existing name based checks have also been improved to allow names
outside of official docker images. The `ImageReference` and `ImageName`
classes have been mainly copied from
`org.springframework.boot.buildpack.platform.docker.type`.

Closes gh-35154
2023-04-24 16:40:07 -07:00
Andy Wilkinson b64adbc34b Fix disabled conditions on AbstractDockerComposeIntegrationTests 2023-04-20 16:12:36 +01:00
Andy Wilkinson 2bccd586ea Fix DockerComposeFileTests on Windows 2023-04-19 15:36:07 +01:00
Stephane Nicoll 8946c761ee Polish 2023-04-17 13:23:51 +02:00
Andy Wilkinson 78242cb794 Skip tests when Docker is unavailable
See gh-34747
2023-04-17 10:33:35 +01:00
Andy Wilkinson 3a01759a3b Protect tests against unstable toString ordering
See gh-34747
2023-04-17 10:27:56 +01:00
Phillip Webb 3657f73b9a Provide more verbose docker compose logging
Update `up` and `start` operations so that real-time logging is
provided. Prior to this commit, lengthy pull operations were not
logged which gave the impression that the application had
crashed.

Closes gh-34994
2023-04-17 01:00:37 -07:00
Phillip Webb efff253d35 Fallback to finding docker image name from compose ps
Earlier versions of docker do not include the image name in the inspect
output. We now fallback to using the `compose ps` response.

Closes gh-34993
2023-04-17 01:00:20 -07:00
Mortitz Halbritter 842e17eced Add Docker Compose support
Add `spring-boot-docker-compose` module with service connection
support.

Closes gh-34747

Co-authored-by: Phillip Webb <pwebb@vmware.com>
Co-authored-by: "Andy Wilkinson <wilkinsona@vmware.com>
2023-04-17 01:00:08 -07:00