Skip to content

Releases: testcontainers/testcontainers-rs

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)

v0.16.7

01 May 21:56
476f0df
Compare
Choose a tag to compare

Details

Bug Fixes

  • get_host for unix and npipe docker hosts (#621)

Features

  • Extend WaitFor for ExecCommand (#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

30 Apr 21:28
1e5c273
Compare
Choose a tag to compare

Details

Features

  • Add get_host to Container and deprecate get_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

29 Apr 20:52
b2059e9
Compare
Choose a tag to compare

Details

Bug Fixes

  • Correct drop of a network for sync container (#612)
  • Correct default for get_host_ip_address in case of unix or npipe (#613)

Miscellaneous Tasks

  • Update serde-java-properties to 0.2.0 (#614)

Migration guide

See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x

v0.16.4

29 Apr 19:59
b4d1624
Compare
Choose a tag to compare

Details

Bug Fixes

  • Properly expose mapped ports (#610)

Features

  • Introduce properties-config cargo feature (#608)
  • Support docker auth configuration for image pulling (#609)

Migration guide

See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x

v0.16.3

27 Apr 22:36
ba44240
Compare
Choose a tag to compare

Details

Bug Fixes

  • Expose mount-related types (#603)

Migration guide

See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x

v0.16.2

27 Apr 22:16
a8a58bf
Compare
Choose a tag to compare

Details

Documentation

  • Fix docsrs attributes

Migration guide

See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x

v0.16.1

27 Apr 21:36
4b910d9
Compare
Choose a tag to compare

Details

Documentation

  • Add readme to crates.io and fix documentation builds (#598)
  • Fix symlink to readme (#600)

Migration guide

See the migration guide in release 0.16.0. To update from 0.15 to 0.16.x

v0.16.0

27 Apr 21:09
7641fbc
Compare
Choose a tag to compare

Details

Bug Fixes

  • Use the binds option instead of volumes for mounts (#581)

Documentation

  • Mention a way to preserve running containers (#586)

Features

  • Support for docker cli flag --add-host (#547)
  • Allow to override args in a RunnableImage (#558)
  • Add name parameter to RunnableImage (#549)
  • [❗] Container-centric API with refactored underlying layer (#575)
  • Add ability to pull-image explicitly (#579)

Miscellaneous Tasks

  • Remove spectral from dev-dependencies (#526)
  • Update reqwest requirement from 0.11.14 to 0.12.3 (#569)
  • Update bollard and bollard-stubs (#574)
  • Reuse workspace level configs (#568)

Refactor

  • [❗] Api for mounts and volumes (#596)

Styling

  • Derive Default to fix clippy lint (#525)
  • Actualize formatting configs (#567)
  • Enable StdExternalCrate grouping

Migration guide

  • Sync API migration (Cli client)
    • Add blocking feature
    • Drop all usages of clients::Cli
    • Add use testcontainers::runners::SyncRunner;
    • Replace client.run(image) with image.start()
  • Async API migration (Http client)
    • Remove experimental feature
    • Drop all usages of clients::Http
    • Add use testcontainers::runners::AsyncRunner;
    • Replace client.run(image) with image.start()
  • ENV variable TESTCONTAINERS was renamed to TESTCONTAINERS_COMMAND and still accepts either remove (default to remove containers on drop) or keep
  • ExecCommand interface was changed to builder-like:
    • use ExecCommand::new(cmd) instead of ExecCommand { ... }
    • cmd is Vec<String> now, so make sure your commands are separated
    • use any of the new methods to check the result with_container_ready_conditions & with_cmd_ready_condition
  • If your Image implements volumes method:
    • rename method to mounts
    • wrap all existed "volumes" into Mount::bind_mount(host_path, container_path)
  • If your code uses RunnableImage::with_volume
    • replace the call with RunnableImage::with_mount
  • If your code uses GenericImage::with_volume
    • replace the call with GenericImage::with_mount

Docker host resolution

We have completely switched to an http client with special host resolution logic.
The host is resolved in the following order:

  1. Docker host from the tc.host property in the ~/.testcontainers.properties file.
  2. DOCKER_HOST environment variable.
  3. Docker host from the "docker.host" property in the ~/.testcontainers.properties file.
  4. Else, the default Docker socket will be returned.

0.15

05 Oct 02:44
4ba1c33
Compare
Choose a tag to compare
Merge pull request #524 from testcontainers/release/0.15