Releases: testcontainers/testcontainers-rs
Releases · testcontainers/testcontainers-rs
v0.21.1
v0.21.0
v0.20.1
v0.20.0
[0.20.0] - 2024-07-07
Details
Bug Fixes
- [❗] Drop
Cloneimpl forContainerRequest(#680) - Exclude image pulling time from startup timeout (#687)
- Waiting for mutiple messages from the same log frame (#688)
- Pass correct log-source for
stderrwait strategy (#692)
Features
- Introduce log consumers (#681)
- Introduce
LoggingConsumerbased onlogcrate (#682) - [❗] Enhance
LogWaitStrategyto wait for message appearance multiple times (#683) - [❗] Introduce
ExitWaitStrategy(#684)
Miscellaneous Tasks
- Get rid of outdated variables naming (#679)
- Relax log level for log producer error (#685)
- Re-configure blocking runtime (#690)
Performance
- Avoid spawning log producer without consumers (#689)
Refactor
- Internal log processing structures (#678)
Styling
- Apply clippy suggestion (#693)
v0.19.0
[0.19.0] - 2024-06-27
Details
Bug Fixes
- [❗] Use
rustls-tlsas default forreqwest(#672)
Documentation
- Update examples of
GenericImage::with_exposed_port(#670)
Features
- Add ability to convert
ContainerPorttou16(#664)
Miscellaneous Tasks
- Make
portsmodule public (#665)
Performance
- Use separate dropper thread for
current_threadflavor (#666)
Refactor
- Use multi-threaded runtime for blocking feature (#667)
v0.18.0
[0.18.0] - 2024-06-15
Overview
Most of the breaking changes introduced in this version primarily impact developers who implement their own images. For general usage, the API remains mostly the same, with some improvements and enhancements for better performance and flexibility.
See migration guide below.
Details
Bug Fixes
- [❗] Make
DOCKER_CONFIGusage consistent with Docker CLI (#654)
Features
Miscellaneous Tasks
- Use nightly
rustfmt(#657)
Refactor
- [❗] Get rid of associated type
ImageArgsand rename tocmd(#649) - Avoid unnecessary owned structs and boxing (#651)
- [❗] Add
ImageExttrait to avoid explicit conversion toRunnableImage(#652) - [❗] Rename
RunnableImagetoContainerRequest(#653) - [❗] Exposed and mapped ports api (#656)
- Preliminary refactoring of
waitstrategies (#661)
Migration Guide
1. Renaming of RunnableImage
- Old:
RunnableImage - New:
ContainerRequest- Update: The explicit conversion from
ImagetoContainerRequest(formerlyRunnableImage) is no longer necessary. Instead, you can now directly importtestcontainers::ImageExtand override image parameters as needed.
- Update: The explicit conversion from
2. Changes to Image Methods
- Method:
Image::tagandImage::name- Old Return Type:
String - New Return Type:
&str - Update: Update any code that relies on these methods to handle the new return type
&str. This change helps improve performance by avoiding unnecessary allocations.
- Old Return Type:
3. Changes to Image::exposed_ports
- Method:
Image::exposed_ports- Old Return Type: Implementation-specific or previously different.
- New Return Type:
&[ContainerPort] - Update: The method now returns a slice of
ContainerPort, which supports exposing ports with protocolsTCP,UDP, andSCTP. Update your code to handle the slice accordingly.
4. Removal of Associated Type Args in Image
- Old:
Imagehad an associated typeArgs. - New: The associated type
Argsis removed.- Update: Command arguments are now part of
Image::cmd, which returnsimpl IntoIterator<Item = impl Into<String>>. This change allows more flexibility in specifying command arguments. Ensure your code is updated to work with the new method signature.
- Update: Command arguments are now part of
5. Simplification of Trait Implementation in Image
- Old:
ImagerequiredBox<dyn ..>for certain traits. - New: Utilizes Return Position
implTrait in Trait (RPITIT).- Update: Instead of requiring
Box<dyn ..>,Imagenow uses RPITIT for trait returns. This change simplifies the code and improves readability and performance. Familiarize yourself with RPITIT to understand its benefits and applications in your implementation.
- Update: Instead of requiring
6. Changes to RunnableImage::with_mapped_port
- Old:
RunnableImage::with_mapped_port - New: Accessible through
ImageExt::with_mapped_port- Update: This method now accepts two parameters instead of a tuple. Adjust your method calls to pass the parameters separately.
v0.17.0
Migration guide
- The largest change of this release is switch to fallible API (instead of panics)
- the easiest way to use
unwraporexpectfor alltestcontainersoperations. - or you can cast error if your tests are already
Resultbased
- the easiest way to use
- The
Image::exec_after_startmethod returns aResult, so if you have an implementation ofImagethat usesexec_after_start, it's important to handle possible errors (e.g required port not found) - If you encounter container startup timeout, adjust it with
RunnableImage::with_startup_timeout - Change
testcontainers::CgroupnsModetotestcontainers::core::CgroupnsModeif your code rely on this. execnow returns a result with ability to get exit code and logs of the command. You can ignore the result if you don't need this.
Details
Bug Fixes
- Collect bridge IP address correctly (#626)
Features
- Impl
ErrorforWaitError(#629) - [❗] Extend
execinterface to return logs and exec code (#631) - Ability to access container logs (#633)
- [❗] Switch to fallible API (#636)
- Make container and exec logs
Sendable (#637) - Map container not found error to
eoffor container log streams (#639) - Expose follow flag for
stdoutandstderr(#640) - Add ability to read container logs into
Vec(#641) - [❗] Add container startup timeout with default of 1 minute (#643)
Miscellaneous Tasks
- Fix clippy warning without features enabled (#632)
Refactor
v0.16.7
Details
Bug Fixes
get_hostforunixandnpipedocker hosts (#621)
Features
- Extend
WaitForforExecCommand(#622)
Migration guide
See the migration guide in release 0.16.0 in order to upgrade the crate from 0.15 to 0.16.x version
v0.16.6
Details
Features
- Add
get_hosttoContainerand deprecateget_host_ip_address(#618) - Allow cgroupns-mode and userns-mode to be configured (#605)
Migration guide
See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x
v0.16.5
Details
Bug Fixes
- Correct drop of a network for sync container (#612)
- Correct default for
get_host_ip_addressin case ofunixornpipe(#613)
Miscellaneous Tasks
- Update
serde-java-propertiesto0.2.0(#614)
Migration guide
See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x