chore(deps): update testcontainers.version to v1.18.0
This MR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
org.testcontainers:postgresql (source) |
1.17.3 -> 1.18.0
|
||||
org.testcontainers:testcontainers (source) |
1.17.3 -> 1.18.0
|
Release Notes
testcontainers/testcontainers-java
v1.18.0
Core module
- Modules images such as
MySQLContainer
are now automatically compatible with their corresponding images with thelibrary
prefix
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 ortc.<image-name:tag>
for a specific one. Check the logging docs. - There is a new
WaitStrategy
,ShellStrategy
. It can also be used by callingWait.forSuccessfulCommand(<command>)
New integration
Jib has been integrated to Testcontainers in order to take advantage of the nice API it provides to create containers
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
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cratedb</artifactId>
<version>1.18.0</version>
<scope>test</scope>
</dependency>
testImplementation "org.testcontainers:cratedb:1.18.0"
Choose a crate image version and use it as declared below with your postgres driver
CrateDBContainer cratedb = new CrateDBContainer("crate:5.2.5");
Solace Module
In order to use SolaceContainer
, declare the dependency in your pom.xml/build.gradle
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>solace</artifactId>
<version>1.18.0</version>
<scope>test</scope>
</dependency>
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:
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.
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:
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
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
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
@​Testcontainers(parallel = true)
class ParallelTest {
@​Container
private static final PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:15-alpine")
.withCopyFileToContainer(MountableFile.forClasspathResource("db.sql"), "/docker-entrypoint-initdb.d/")
.withNetwork(network)
.withNetworkAliases("postgres");
@​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
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:
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.
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:
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 (#5827) @AB-xdev
- Move junit-jupiter-api's dependency configuration to implementation (#5985) @edysli
🚀 Features & Enhancements
- Improve startup wait checks (#6384) @deejgregor
- #6667: reset network creation state if network creation fails. (#6668) @k-wall
- [Feature]: ShellStrategy, a new WaitStrategy (#6672) @m4rii0
- feat: also check DOCKER_AUTH_CONFIG for registry auth config as an alternative to config.json (#6238) @roseo1
- Ensure readability of MySQL and MariaDB config override (#6625) @famod
- Bugfix: Log consumers are now called with exactly one complete log line (#5854) @SgtSilvio
- ClickHouse uses new driver if it is available and version is compatible (#6236) @trolley813
- Add devcontainer file (#6412) @eddumelendez
- Add Docker image name to ContainerLaunchException message (#6408) @Donnerbart
- Make sure we don't hide exceptions from waitUntilContainerStarted (#6167) @deejgregor
- feat: enable reuse for mongodb (#6235) @tiboun
- Avoid Pattern recompilation in log output processing (#6239) @dreis2211
- Fixes the issue of missing root cause in container launch TimeoutException (e.g. SSLHandshakeException) (#5778) @cdanger
☠ ️ Deprecations
- Deprecate VaultContainer#withLogLevel (#6795) @eddumelendez
🐛 Bug Fixes
- Short-circuit CompletableFuture returned by Startables#deepStart on exception (#5930) @pivovarit
- fix: Don't return JSON auth config for partial registry name match (#6323) @kiview
- Fix
allowInsecure()
onHttpWaitStrategy
for non-localhost Docker daemon (#6314) @kiview
v1.17.6
What's Changed
Highlights
This release has been made possible through the efforts of 20 contributors. The Testcontainers does not cease to amaze us, thanks to everyone of you and thanks for the ongoing support and collaboration 🥰.
This release brings a lot of database love with 2 new modules, and as always a couple of bug fixes and improvements
#5995) @Vangreen
New Module: QuestDB (QuestDB, is a high-performance, open-source SQL database for applications in financial services, IoT, machine learning, DevOps and observability.
var container = new QuestDBContainer("questdb/questdb:6.5.3")
container.start()
var connectionUrl = container.getHttpUrl()
// use the connectionUrl and start testing!
#4372) @srinivasa-vasu
New Module: YugabyteDB (YugabyteDB, is a modern distributed SQL database for transactional cloud native applications. PostgreSQL compatible. It offers two APIs, SQL and CQL.
var container = new YugabyteDBYSQLContainer("yugabytedb/yugabyte:2.14.4.0-b26");
container.start()
var jdbcUrl = container.getJdbcUrl();
// use the jdbcUrl and start testing!
var container = new YugabyteDBYCQLContainer("yugabytedb/yugabyte:2.14.4.0-b26");
container.start()
var contactPoint = container.getContactPoint();
// use the contactPoint and start testing!
🚀 Features & Enhancements
- InfluxDB v2 support (#3669) @raminqaf
- Add support for flags in DatastoreEmulatorContainer (#5993) @eddumelendez
- Expose Redpanda schema registry (#5994) @gustavomonarin
- Adds the ability to set a target build stage to a Dockerfile (#4810) @GenghisChen
🐛 Bug Fixes
- Fixes wrong timestamp calculation (#5988) @leblonk
- Catch and ignore more errors when reflecting into container subclass (#5990) @akhaku
- Return default for empty environment variable (#5983) @roulpriya
📖 Documentation
- Add Spotify in Donors section (#6083) @eddumelendez
- Updated Vault docs, uplifted Vault image version (#3685) @RamazanYapparov
- Add Hazelcast Example (#6117) @tomazfernandes
- Improve ToxiProxyContainer test and docs (#6065) @eddumelendez
- fix link zookeeper (#6079) @rnzit
- chore: sync governance files (#6075) @kiview
- Update docs to better reflect the links to other languages (#6068) @kiview
- Add step to create symlink when Docker for Mac 4.13 is installed (#6064) @eddumelendez
- Add language links to docs index (#6067) @leocross
- Update gitlab_ci.md with clarifying note about the docker host port number (#6063) @BenManifold
- Add zookeeper example (#6059) @eddumelendez
- Add travis minimal configuration (#6056) @eddumelendez
- fix: edit link in documentation (#6055) @DanielHabenicht
- Deprecate
setCustomContent
andwithCustomContent
atNginxContainer
(#5997) @eddumelendez - Add paragraph about Docker requirements to docs (#5987) @kiview
- Add reference to supported languages (#5979) @eddumelendez
- doc: Update logback-test.xml example to show how to enable DEBUG only for Testcontainers (#5976) @edysli
🧹 Housekeeping
- Remove "Starting an elasticsearch container" message in constructor (#6127) @deejgregor
- Apply spotless and checkstyle to examples (#6061) @eddumelendez
- Remove unused Pipfiles (#6046) @kiview
- Update toxiproxy image to ghcr.io/shopify/toxiproxy (#5996) @eddumelendez
- Deprecate
setCustomContent
andwithCustomContent
atNginxContainer
(#5997) @eddumelendez - Remove Transferable#of(java.lang.String,int) for japicmp (#5992) @eddumelendez
- Remove unnecessary configuration from simple tests (#5973) @JanHendrikDolling
- Fix dependabot.yml ignore section (#5999) @eddumelendez
- Update set-output command in workflows (#6058) @eddumelendez
- Use
gradle/gradle-build-action
(#6121) @eddumelendez - Add lang and version labels to containers (#6124) @eddumelendez
- Fix labeler configuration (#6157) @eddumelendez
📦 Dependency updates
9 changes
* Ignore updates for org.neo4j:neo4j (#6112) @eddumelendez * Combined dependencies MR (#6210) @eddumelendez * Combined dependencies MR (#6205) @eddumelendez * Combined dependencies MR (#6173) @eddumelendez * Combined dependencies MR (#6153) @eddumelendez * Combined dependencies MR (#6150) @eddumelendez- Combined dependencies MR (#6118) @eddumelendez
- Combined dependencies MR (#6114) @eddumelendez
- Combined dependencies MR (#6113) @eddumelendez
- Combined dependencies MR (#6212) @eddumelendez
v1.17.5
What's Changed
Warning Version 1.17.4 was released upgrading slf4j-api to version 2.x. This dependency has been reverted to 1.17.x.
- Rollback back to slf4j-api 1.7.36 (#5951) @kiview
- Bump logback-classic versions (#5948) @eddumelendez
- Bump kotlin plugins version to 1.7.20 (#5945) @eddumelendez
- Add banner when Ryuk is disabled (#5929) @eddumelendez
📖 Documentation
- Test container example for ImmuDB (#5860) @hariohmprasath
- Reference to GitHub Discussions (#5928) @eddumelendez
- Rename main branch (#5847) @eddumelendez
📦 Dependency updates
- Combined dependencies MR (#5944) @eddumelendez
- Combined dependencies MR (#5936) @eddumelendez
- Combined dependencies MR (#5935) @eddumelendez
- Combined dependencies MR (#5931) @eddumelendez
v1.17.4
What's Changed
Highlights
This release has been made possible through the efforts of whopping 23 contributors, wow! 🤯
Besides 3 new modules, this release brings a couple of bugfixes, improved compatibility and resilience in certain scenarios, better defaults and more configurability.
You might also notice many MRs related to the documentation, templates for MRs and issues, and automation regarding OSS contributions. Testcontainers has always been a project with a lot of involvement by the community and we are very proud of this. That’s why want to make contributing to Testcontainers a great experience, no matter if you raise an issue, submit a MR or initiate a discussion in GitHhub Discussions.
🐼 New Module: Redpanda (#5740) @eddumelendez
Redpanda, a Kafka-compatible streaming platform, recently added a special dev-container
mode to their container image, that allows even faster startup times. A great reason to work in a Testcontainers module that leverages this flag by default to give you a great integration testing experience when using Redpanda. And of course, using Redpanda with Testcontainers is as easy and convenient as you are used to:
var container = new RedpandaContainer("docker.redpanda.com/vectorized/redpanda:v22.2.1")
container.start()
var connectionUrl = container.getBootstrapServers()
// use the connectionUrl and start testing!
You can check out the docs to learn more.
#5511) @Icemap
New Module: TiDB (With TiDB, we are adding support for a new database module. As with other databases that can be accessed via JDBC, you can leverage Testcontainers’ special JDBC URL integration:
jdbc:tc:tidb:v6.1.0:///databasename
#4683) @julb
New Module: Hashicorp Consul (
🚀 Features & Enhancements
- getContainerByServiceName should work without suffix (#5776) @REslim30
- Allow Pulsar default WaitStrategy to honour startup timeout (#5674) @nahguam
- fix: ContainerDatabaseDriver does not register Properties object (#5829) @REslim30
- couchbase: allow to configure bucket replicas and default to 0. (#5840) @daschl
- Add compatibility with MongoDB 6 (#5771) @eddumelendez
- Set default elasticsearch heap size to 2GB (Alternate MR) (#5684) @REslim30
- Add
Transferable.of(String, int)
(#5741) @eddumelendez - Make TestcontainersExtension public (#5285) @hmatt1
- Update Cassandra driver to 4.x (#2830) @emerkle826
- Make outer maximum startup timeout in
DockerComposeContainer
configurable (#5588) @henri-tremblay - Improve Pulsar's wait strategy to rely on clusterName (#5613) @eddumelendez
🐛 Bug Fixes
- getLivenessCheckPortNumbers() should return mapped port (#5734) @REslim30
📖 Documentation
- Improve consistency of Testcontainers name in docs (#5866) @neslihanedes
- Fix typos on index.md (#5832) @neslihanedes
- docs: fix link to the bounty program (#5831) @mdelapenya
- Fix link for Selenium examples (#5786) @kiview
- Remove
disque-job-queue
andmongodb-container
examples (#5782) @eddumelendez - Upgrade spring-boot version to 2.7.3 in examples (#5764) @eddumelendez
- Add samples section (#5763) @eddumelendez
- Add Consul module (#4683) @julb
- Add syntax highlighting to colima usage doc (#5673) @kishaningithub
- Link to the docs on environment discovery failure (#5615) @bsideup
- Add docs for AWS CodeBuild and Tekton (#5614) @eddumelendez
- Update CircleCI docs for current Cloud/v2/v3 configuration (#5611) @epragtbeamtree
- Update Oracle-XE docs and use code example from tests (#4385) @kiview
- Enable JUnitPlatform in Gradle for JUnit5 examples (#4130) @kiview
- Add documentation for DependsOn (#5597) @QuinnBast
- Improve docs (#5522) @eddumelendez
- Improve Issue Templates (#5836) @eddumelendez
- Fix type/docs label (#5759) @eddumelendez
- Add Merge Request Template (#5735) @eddumelendez
🧹 Housekeeping
- Update localstack images in tests (#5783) @eddumelendez
- Remove thundra from ci.yml (#5850) @eddumelendez
- Exclude
org.testcontainers.shaded.*
package and upgrade deps (#5775) @eddumelendez - Revert "Update GHA runner image to latest Ubuntu" (#5766) @kiview
- Add test-retry plugin (#5586) @eddumelendez
- GitHub Workflows security hardening (#5821) @sashashura
- Add host os and arch in bug report template (#5525) @eddumelendez
- getLivenessCheckPortNumbers() should return mapped port (#5734) @REslim30
- Use
testCompileOnly
instead oftestCompileClasspath
(#5849) @eddumelendez - Update slf4j in test-support to 2.0.0 (#5848) @kiview
- Remove
disque-job-queue
andmongodb-container
examples (#5782) @eddumelendez - Run mongosh or mongo if cmd exists (#5774) @eddumelendez
- Add .sdkmanrc with 8.0.345-tem (#5772) @eddumelendez
- Add link to GH Discussions to Issue forms (#5767) @eddumelendez
- [couchbase] Only expose ports for enabled services (#4595) @daschl
- Update GHA runner image to latest Ubuntu (#5761) @kiview
- Enforce UTF-8 as Javadoc encoding (#5738) @gesellix
- Drop usage of
org.junit.platform.commons.util
(#5729) @eddumelendez - Move junit4 to assertj (#5685) @eddumelendez
- Removes unused module junit-toolbox (#5678) @froque
- Move to assertj (#5679) @eddumelendez
- Add pr label for area/docker-compose (#5610) @eddumelendez
- Update alpine image to 3.16 (#4698) @tobiasstadler
- Update spotless version to 6.8.0 (#5605) @eddumelendez
- Fix javadoc comment in ToxiproxyContainer#getProxy(GenericContainer, int) (#5591) @kwart
- chore: Set permissions for GitHub actions (#5523) @naveensrinivasan
- Add labeler action (#5516) @eddumelendez
📦 Dependency updates
- Update ryuk version to 0.3.4 (#5619) @eddumelendez
- Combined dependencies MR (#5820, #5816, #5762, #5758, #5757, #5733, #5730, #5672, #5671, #5668, #5587, #5583, #5580) @eddumelendez
- Update Gradle Wrapper to 7.5.1 (#5676) @github-actions
- Update Gradle Wrapper to 7.5 (#5598) @github-actions
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.