testcontainers / testcontainers-rs

A library for integration-testing against docker containers from within Rust.
https://rust.testcontainers.org
Apache License 2.0
703 stars 137 forks source link

refactor!: add `ImageExt` trait to avoid explicit conversion to `RunnableImage` #652

Closed DDtKey closed 3 months ago

DDtKey commented 3 months ago

This PR allows to override some image values without explicit conversion to RunnableImage.

For example:

// Instead of this:
use testcontainers::RunnableImage;
RunnableImage::from(image).with_tag("x").with_network("a").start();

// It can be done directly on image:
use testcontainers::ImageExt;
image.with_tag("x").with_network("a").start();

Also, it allows to simplify GenericImage. Because it was kinda duplicative code.

netlify[bot] commented 3 months ago

Deploy Preview for testcontainers-rust ready!

Name Link
Latest commit dd3721052c99c18f1bbe1dfc6ae89ab24f21fcee
Latest deploy log https://app.netlify.com/sites/testcontainers-rust/deploys/6668b679136e43000889898c
Deploy Preview https://deploy-preview-652--testcontainers-rust.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.