What's Changed
Thank you to all the contributors ๐.
In version 4.7.0, we noticed that the reuse hash could change depending on the order of dictionary values. This has been fixed to ensure that dictionary values are processed in a consistent order when generating the reuse hash. As a result, the reuse hash will likely change again with 4.8.0.
Wait strategies now default to the Running mode. This mode expects the container to remain running throughout startup. If the container exits unexpectedly, Testcontainers will throw a ContainerNotRunningException that includes the exit code and container logs.
The container startup callback now includes an additional overload that provides the actual container configuration. If you implement IContainerBuilder<TBuilderEntity, TContainerEntity>, you need to add the container configuration (e.g., IContainerConfiguration) as a third generic type constraint to IContainerBuilder.
IContainerBuilder.WithResourceMapping and IContainer.CopyAsync now include two new optional arguments: uid and gid. If you do not need to specify those, use named arguments for the existing parameters: fileMode or ct.
โ ๏ธ Breaking Changes
- fix: Generate consistent reuse hashes by sorting dictionary keys (#1554) @0xced
- feat: Throw if container not running (#1550) @HofmeisterAn
- feat: Add startup callback overload with configuration type (#1547) @HofmeisterAn
- feat: Support UID/GID when copying files (#1531) @HofmeisterAn
๐ Features
- feat: Throw if container not running (#1550) @HofmeisterAn
- feat: Add startup callback overload with configuration type (#1547) @HofmeisterAn
- feat: Add Docker build context (#1536) @HofmeisterAn
- feat: Add
WithTarget(string)to image builder (#1534) @HofmeisterAn - feat: Resolve Dockerfile ARGs pulling base images (#1532) @HofmeisterAn
- feat: Support UID/GID when copying files (#1531) @HofmeisterAn
- feat(Keycloak): Add API to import a realm configuration file (#1526) @VladislavAntonyuk
๐ Bug Fixes
- fix: Generate consistent reuse hashes by sorting dictionary keys (#1554) @0xced
- fix(MongoDb): Use
db.runCommand({hello:1})do detect readiness (#1548) @HofmeisterAn - fix(Papercut): Pin version 7.0 and set new HTTP and SMTP ports (#1549) @HofmeisterAn
- fix(Pulsar): Wait for default namespace (#1539) @HofmeisterAn
- fix(Keycloak): Wait until user created (#1535) @HofmeisterAn
๐ Documentation
- docs: Remove obsolete UntilOperationIsSucceeded wait strategy example (#1551) @ascott18
- docs: Fix link to Ryuk in
IContainerBuilder.WithAutoRemovecode comment (#1546) @hojmark
๐งน Housekeeping
- chore: Don't create a static field in a generic class (#1555) @HofmeisterAn
- chore: Add test certificates to common project (#1545) @HofmeisterAn
- chore: Update CI workflow to ubuntu-24.04 (#1544) @HofmeisterAn
- chore: Collect test projects at CI runtime (#1543) @HofmeisterAn
- chore: Fix grammar (#1542) @Smoothengineer
- chore: Bump Ryuk (#1537) @HofmeisterAn
- chore: Remove obsolete wait strategy:
UntilPortIsAvailable(int)(#1528) @HofmeisterAn - feat: Prepare next release cycle (4.8.0) (#1523) @HofmeisterAn