Skip to content

Releases: testcontainers/testcontainers-rs

v0.23.1

26 Sep 00:08
4049724
Compare
Choose a tag to compare

Details

Features

  • Expose configured bollard client (#740)

v0.23.0

25 Sep 11:16
1b5e545
Compare
Choose a tag to compare

Details

Bug Fixes

  • Expose public copy types (#734)
  • Typo in an error variant (#738)

Features

  • Support copy files to container (#730)
  • Support copying directories to container (#735)

Miscellaneous Tasks

  • Copy-to-container interface improvements (#732)

Refactor

  • Replace dirs crate with etcetera (#736)

v0.22.0

30 Aug 19:22
df5fb05
Compare
Choose a tag to compare

Details

Bug Fixes

  • [❗] Docker socket detection on unix (#721)

Features

  • Add working_dir to ContainerRequest,ImageExt (#724)

Miscellaneous Tasks

  • Added #![forbid(unsafe_code)] to the library (#722)

v0.21.1

05 Aug 23:42
3f30ac8
Compare
Choose a tag to compare

[0.21.1] - 2024-08-05

Details

Features

  • Allow configuring resource ulimits (#714)

v0.21.0

30 Jul 20:09
f8d4a3d
Compare
Choose a tag to compare

Details

Bug Fixes

  • Don't assume docker host is a url (#709)

Miscellaneous Tasks

  • Bump the bollard group across 1 directory with 2 updates (#710)

Refactor

  • [❗] Put reqwest behind http_wait feature (#705)

v0.20.1

18 Jul 13:25
eae71c6
Compare
Choose a tag to compare

Details

Bug Fixes

  • Trim newline char from the mirrored messages (#699)

Features

  • Support optional prefix for LoggingConsumer (#698)

v0.20.0

07 Jul 15:51
e9cc412
Compare
Choose a tag to compare

[0.20.0] - 2024-07-07

Details

Bug Fixes

  • [❗] Drop Clone impl for ContainerRequest (#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 on log 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

28 Jun 09:19
f80f4cd
Compare
Choose a tag to compare

[0.19.0] - 2024-06-27

Details

Bug Fixes

  • [❗] Use rustls-tls as default for reqwest (#672)

Documentation

  • Update examples of GenericImage::with_exposed_port (#670)

Features

  • Add ability to convert ContainerPort to u16 (#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

15 Jun 21:02
0afec13
Compare
Choose a tag to compare

[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

  • [❗] Support UDP and SCTP port mappings (#655)
  • Support HTTP wait strategy (#659)

Miscellaneous Tasks

  • Use nightly rustfmt (#657)

Refactor

  • [❗] Get rid of associated type ImageArgs and rename to cmd (#649)
  • Avoid unnecessary owned structs and boxing (#651)
  • [❗] Add ImageExt trait to avoid explicit conversion to RunnableImage (#652)
  • [❗] Rename RunnableImage to ContainerRequest (#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 to ContainerRequest (formerly RunnableImage) is no longer necessary. Instead, you can now directly import testcontainers::ImageExt and override image parameters as needed.

2. Changes to Image Methods

  • Method: Image::tag and Image::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.

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 protocols TCP, UDP, and SCTP. Update your code to handle the slice accordingly.

4. Removal of Associated Type Args in Image

  • Old: Image had an associated type Args.
  • New: The associated type Args is removed.
    • Update: Command arguments are now part of Image::cmd, which returns impl 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.

5. Simplification of Trait Implementation in Image

  • Old: Image required Box<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.

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

26 May 20:47
03d534b
Compare
Choose a tag to compare

Migration guide

  • The largest change of this release is switch to fallible API (instead of panics)
    • the easiest way to use unwrap or expect for all testcontainers operations.
    • or you can cast error if your tests are already Result based
  • The Image::exec_after_start method returns a Result, so if you have an implementation of Image that uses exec_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 to testcontainers::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 for WaitError (#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 Sendable (#637)
  • Map container not found error to eof for container log streams (#639)
  • Expose follow flag for stdout and stderr (#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

  • [❗] Drop re-export of CgroupnsMode accessible through core (#630)
  • [❗] Drop previously deprecated get_host_ip_address (#628)
  • [❗] Return PortNotExposed error from ContainerState::host_port_* (#644)