Releases: testcontainers/testcontainers-rs
Releases · testcontainers/testcontainers-rs
v0.23.1
v0.23.0
v0.22.0
v0.21.1
v0.21.0
v0.20.1
v0.20.0
[0.20.0] - 2024-07-07
Details
Bug Fixes
- [❗] Drop
Clone
impl 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
stderr
wait strategy (#692)
Features
- Introduce log consumers (#681)
- Introduce
LoggingConsumer
based onlog
crate (#682) - [❗] Enhance
LogWaitStrategy
to 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-tls
as default forreqwest
(#672)
Documentation
- Update examples of
GenericImage::with_exposed_port
(#670)
Features
- Add ability to convert
ContainerPort
tou16
(#664)
Miscellaneous Tasks
- Make
ports
module public (#665)
Performance
- Use separate dropper thread for
current_thread
flavor (#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_CONFIG
usage consistent with Docker CLI (#654)
Features
Miscellaneous Tasks
- Use nightly
rustfmt
(#657)
Refactor
- [❗] Get rid of associated type
ImageArgs
and rename tocmd
(#649) - Avoid unnecessary owned structs and boxing (#651)
- [❗] Add
ImageExt
trait to avoid explicit conversion toRunnableImage
(#652) - [❗] Rename
RunnableImage
toContainerRequest
(#653) - [❗] Exposed and mapped ports api (#656)
- Preliminary refactoring of
wait
strategies (#661)
Migration Guide
1. Renaming of RunnableImage
- Old:
RunnableImage
- New:
ContainerRequest
- Update: The explicit conversion from
Image
toContainerRequest
(formerlyRunnableImage
) is no longer necessary. Instead, you can now directly importtestcontainers::ImageExt
and override image parameters as needed.
- Update: The explicit conversion from
2. Changes to Image
Methods
- Method:
Image::tag
andImage::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:
Image
had an associated typeArgs
. - New: The associated type
Args
is 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:
Image
requiredBox<dyn ..>
for certain traits. - New: Utilizes Return Position
impl
Trait in Trait (RPITIT).- Update: Instead of requiring
Box<dyn ..>
,Image
now 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
unwrap
orexpect
for alltestcontainers
operations. - or you can cast error if your tests are already
Result
based
- the easiest way to use
- The
Image::exec_after_start
method returns aResult
, so if you have an implementation ofImage
that 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::CgroupnsMode
totestcontainers::core::CgroupnsMode
if your code rely on this. exec
now 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
Error
forWaitError
(#629) - [❗] Extend
exec
interface to return logs and exec code (#631) - Ability to access container logs (#633)
- [❗] Switch to fallible API (#636)
- Make container and exec logs
Send
able (#637) - Map container not found error to
eof
for container log streams (#639) - Expose follow flag for
stdout
andstderr
(#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)