Skip to content

Commit

Permalink
chore: update testcontainers-java monorepo to v1.18.0 (#1187)
Browse files Browse the repository at this point in the history
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.testcontainers:junit-jupiter](https://testcontainers.org)
([source](https://togithub.com/testcontainers/testcontainers-java)) |
`1.17.6` -> `1.18.0` |
[![age](https://badges.renovateapi.com/packages/maven/org.testcontainers:junit-jupiter/1.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/org.testcontainers:junit-jupiter/1.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/org.testcontainers:junit-jupiter/1.18.0/compatibility-slim/1.17.6)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/org.testcontainers:junit-jupiter/1.18.0/confidence-slim/1.17.6)](https://docs.renovatebot.com/merge-confidence/)
|
| [org.testcontainers:testcontainers](https://testcontainers.org)
([source](https://togithub.com/testcontainers/testcontainers-java)) |
`1.17.6` -> `1.18.0` |
[![age](https://badges.renovateapi.com/packages/maven/org.testcontainers:testcontainers/1.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/org.testcontainers:testcontainers/1.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/org.testcontainers:testcontainers/1.18.0/compatibility-slim/1.17.6)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/org.testcontainers:testcontainers/1.18.0/confidence-slim/1.17.6)](https://docs.renovatebot.com/merge-confidence/)
|

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>testcontainers/testcontainers-java</summary>

###
[`v1.18.0`](https://togithub.com/testcontainers/testcontainers-java/releases/tag/1.18.0)

[Compare
Source](https://togithub.com/testcontainers/testcontainers-java/compare/1.17.6...1.18.0)

#### Core module

- Modules images such as `MySQLContainer` are now automatically
compatible with their corresponding images with the `library` prefix

```java
MySQLContainer<?> mysql = new MySQLContainer<>("library/mysql");
```

- `testcontainers/vnc` has been bumped to version 1.3.0, which brings
ARM support.
- Goodbye to the whale in the logs. In order to provide an easy way to
filter container logs the `tc` prefix has been added to display all
container logs or `tc.<image-name:tag>` for a specific one. Check the
[logging
docs](https://www.testcontainers.org/supported_docker_environment/logging_config/).
- There is a new `WaitStrategy`, `ShellStrategy`. It can also be used by
calling `Wait.forSuccessfulCommand(<command>)`

#### New integration

[Jib](https://togithub.com/GoogleContainerTools/jib) has been integrated
to Testcontainers in order to take advantage of the nice API it provides
to create containers

```java
GenericContainer<?> busybox = new GenericContainer<>(
                new JibImage(
                    "busybox:1.35",
                    jibContainerBuilder -> {
                        return jibContainerBuilder.setEntrypoint("echo", "Hello World");
                    }
                )
            )
                .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofSeconds(3)))
```

#### New modules 🆕

##### CrateDB module

In order to use `CrateDBContainer` , declare the dependency in your
pom.xml/build.gradle

```xml
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>cratedb</artifactId>
    <version>1.18.0</version>
    <scope>test</scope>
</dependency>
```

```gradle
testImplementation "org.testcontainers:cratedb:1.18.0"
```

Choose a [crate](https://hub.docker.com/\_/crate) image version and use
it as declared below with your postgres driver

```java
CrateDBContainer cratedb = new CrateDBContainer("crate:5.2.5");
```

##### Solace Module

In order to use `SolaceContainer` , declare the dependency in your
pom.xml/build.gradle

```xml
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>solace</artifactId>
    <version>1.18.0</version>
    <scope>test</scope>
</dependency>
```

```gradle
testImplementation "org.testcontainers:solace:1.18.0"
```

Now, you can use a Solace PubSub running in a container and connecting
via AMQP by doing the following:

```java
SolaceContainer solace = new SolaceContainer("solace/solace-pubsub-standard:10.2");
solace.start();
Session session = createSession(
                solaceContainer.getUsername(),
                solaceContainer.getPassword(),
                solaceContainer.getOrigin(Service.AMQP)
            );
```

More information about `SolaceContainer` can be found in the
[documentation](https://www.testcontainers.org/modules/solace/).

#### Container modules

##### CockroachDB

Starting with `cockroachdb/cockroach:22.1.0`, there is support for
setting the username, password and database name via environment
variables. Now, the Testcontainers module provides convenient setters:

```java
CockroachContainer cockroach = new CockroachContainer("cockroachdb/cockroach:22.1.0")
    .withUsername("test_user")
    .withPassword("test_password")
    .withDatabaseName("test_database");
```

##### GCloud module

Google has released a new image which supports ARM and therefore
`BigtableEmulatorContainer`, `DatastoreEmulatorContainer`,
`FirestoreEmulatorContainer`, `PubSubEmulatorContainer` now support it
as well.

So, if previously you were doing something like

```java
DockerImageName.parse("gcr.io/google.com/cloudsdktool/google-cloud-cli:380.0.0-emulators")
    .asCompatibleSubstituteFor("gcr.io/google.com/cloudsdktool/cloud-sdk");
```

Now, you can simply do

```java
DockerImageName.parse("gcr.io/google.com/cloudsdktool/google-cloud-cli:380.0.0-emulators");
```

##### JUnit Jupiter Module

`@Testcontainers` offers a new attribute `parallel`, which start those
containers classes annotated by `@Container`

```java
@&#8203;Testcontainers(parallel = true)
class ParallelTest {

	@&#8203;Container
private static final PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:15-alpine")
    .withCopyFileToContainer(MountableFile.forClasspathResource("db.sql"), "/docker-entrypoint-initdb.d/")
    .withNetwork(network)
    .withNetworkAliases("postgres");

@&#8203;Container
private static final ToxiproxyContainer toxiproxy = new ToxiproxyContainer("ghcr.io/shopify/toxiproxy:2.5.0")
    .withNetwork(network);

}
```

##### Kafka Module

Self-managed or Kraft mode (a.k.a Zookeeperless) support has been added

```java
KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:7.0.1")).withKraft()
```

##### LocalStack Module

`SERVICES` environment variable became optional in version 0.13.0 and
instead LocalStack will initialize a service once the first request is
served. So, nowadays `LocalStackContainer` can be used just like this:

```java
LocalStackContainer localstack = new LocalStackContainer("localstack/localstack:2.0.0");
```

Also, LocalStack module supports version 2.0. It is highly recommended
to use the latest version of LocalStack images.
Last but not least, dependency on AWS SDK V1 was dropped. So, that means
by upgrading to version 1.18.0, the dependency can be removed if not
used directly.

##### MongoDB Module

`MongoDBContainer` by default has been enabling ReplicaSet mode.
Starting in this version, sharding has been added.

```java
MongoDBContainer mongodb = new MongoDBContainer("mongo:6")
    .withSharding();
```

##### Selenium Module

Selenium 4 has built-in support for Microsoft Edge (which is based on
Chromium) and now it is supported by `BrowserWebDriverContainer` as
well:

```java
BrowserWebDriverContainer<?> edge = new BrowserWebDriverContainer<>("selenium/standalone-edge:4.8.0")
    .withCapabilities(new EdgeOptions());
```

#### More

#### ⚠️ Breaking API changes

- Removed deprecated methods and undeclared transitive dependency to AWS
SDK v1
([#&#8203;5827](https://togithub.com/testcontainers/testcontainers-java/issues/5827))
[@&#8203;AB-xdev](https://togithub.com/AB-xdev)
- Move junit-jupiter-api's dependency configuration to implementation
([#&#8203;5985](https://togithub.com/testcontainers/testcontainers-java/issues/5985))
[@&#8203;edysli](https://togithub.com/edysli)

#### 🚀 Features & Enhancements

- Improve startup wait checks
([#&#8203;6384](https://togithub.com/testcontainers/testcontainers-java/issues/6384))
[@&#8203;deejgregor](https://togithub.com/deejgregor)
-
[#&#8203;6667](https://togithub.com/testcontainers/testcontainers-java/issues/6667):
reset network creation state if network creation fails.
([#&#8203;6668](https://togithub.com/testcontainers/testcontainers-java/issues/6668))
[@&#8203;k-wall](https://togithub.com/k-wall)
- \[Feature]: ShellStrategy, a new WaitStrategy
([#&#8203;6672](https://togithub.com/testcontainers/testcontainers-java/issues/6672))
[@&#8203;m4rii0](https://togithub.com/m4rii0)
- feat: also check DOCKER_AUTH_CONFIG for registry auth config as an
alternative to config.json
([#&#8203;6238](https://togithub.com/testcontainers/testcontainers-java/issues/6238))
[@&#8203;roseo1](https://togithub.com/roseo1)
- Ensure readability of MySQL and MariaDB config override
([#&#8203;6625](https://togithub.com/testcontainers/testcontainers-java/issues/6625))
[@&#8203;famod](https://togithub.com/famod)
- Bugfix: Log consumers are now called with exactly one complete log
line
([#&#8203;5854](https://togithub.com/testcontainers/testcontainers-java/issues/5854))
[@&#8203;SgtSilvio](https://togithub.com/SgtSilvio)
- ClickHouse uses new driver if it is available and version is
compatible
([#&#8203;6236](https://togithub.com/testcontainers/testcontainers-java/issues/6236))
[@&#8203;trolley813](https://togithub.com/trolley813)
- Add devcontainer file
([#&#8203;6412](https://togithub.com/testcontainers/testcontainers-java/issues/6412))
[@&#8203;eddumelendez](https://togithub.com/eddumelendez)
- Add Docker image name to ContainerLaunchException message
([#&#8203;6408](https://togithub.com/testcontainers/testcontainers-java/issues/6408))
[@&#8203;Donnerbart](https://togithub.com/Donnerbart)
- Make sure we don't hide exceptions from waitUntilContainerStarted
([#&#8203;6167](https://togithub.com/testcontainers/testcontainers-java/issues/6167))
[@&#8203;deejgregor](https://togithub.com/deejgregor)
- feat: enable reuse for mongodb
([#&#8203;6235](https://togithub.com/testcontainers/testcontainers-java/issues/6235))
[@&#8203;tiboun](https://togithub.com/tiboun)
- Avoid Pattern recompilation in log output processing
([#&#8203;6239](https://togithub.com/testcontainers/testcontainers-java/issues/6239))
[@&#8203;dreis2211](https://togithub.com/dreis2211)
- Fixes the issue of missing root cause in container launch
TimeoutException (e.g. SSLHandshakeException)
([#&#8203;5778](https://togithub.com/testcontainers/testcontainers-java/issues/5778))
[@&#8203;cdanger](https://togithub.com/cdanger)

#### ☠️ Deprecations

- Deprecate VaultContainer#withLogLevel
([#&#8203;6795](https://togithub.com/testcontainers/testcontainers-java/issues/6795))
[@&#8203;eddumelendez](https://togithub.com/eddumelendez)

#### 🐛 Bug Fixes

- Short-circuit CompletableFuture returned by Startables#deepStart on
exception
([#&#8203;5930](https://togithub.com/testcontainers/testcontainers-java/issues/5930))
[@&#8203;pivovarit](https://togithub.com/pivovarit)
- fix: Don't return JSON auth config for partial registry name match
([#&#8203;6323](https://togithub.com/testcontainers/testcontainers-java/issues/6323))
[@&#8203;kiview](https://togithub.com/kiview)
- Fix `allowInsecure()` on `HttpWaitStrategy` for non-localhost Docker
daemon
([#&#8203;6314](https://togithub.com/testcontainers/testcontainers-java/issues/6314))
[@&#8203;kiview](https://togithub.com/kiview)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6:00am" in timezone
Europe/Berlin, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/CloudNetService/CloudNet-v3).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS40MC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNDAuMCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored and derklaro committed Apr 17, 2023
1 parent 22d451c commit 228beb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ guava = "31.1-jre"
# testing
junit = "5.9.2"
mockito = "5.3.0"
testcontainers = "1.17.6"
testcontainers = "1.18.0"

# compile time processing
lombok = "1.18.26"
Expand Down

0 comments on commit 228beb2

Please sign in to comment.