16 releases
0.14.0-beta.1 |
|
---|---|
0.3.7 | Apr 6, 2024 |
0.3.6 | Mar 22, 2024 |
0.2.1 | Dec 29, 2023 |
0.1.0-beta.1 | Jun 28, 2023 |
#30 in Testing
27,659 downloads per month
Used in 25 crates
(24 directly)
105KB
2.5K
SLoC
testcontainers-modules
Community maintained modules for testcontainers
Provides modules to use for testing components in accordance with testcontainers-rs. Every module is treated as a feature inside this crate.
Usage
- Depend on testcontainers-modules with necessary features (e.g
postgres
,minio
and etc) - Then start using the modules inside your tests.
Note: you don't need to explicitly depend on testcontainers
as it's re-exported dependency of testcontainers-modules
with aligned version between these crates.
For example:
use testcontainers_modules::testcontainers::RunnableImage;
You can also see examples for more details.
How to override module defaults (version, tag, ENV-variables)
Just use RunnableImage:
use testcontainers_modules::{
redis::Redis,
testcontainers::RunnableImage
};
/// Create a Redis module with `6.2-alpine` tag and custom password
fn create_redis() -> RunnableImage<Redis> {
RunnableImage::from(Redis::default())
.with_tag("6.2-alpine")
.with_env_var(("REDIS_PASSWORD", "my_secret_password"))
}
License
- MIT license (LICENSE or http://opensource.org/licenses/MIT)
Dependencies
~3–4.5MB
~87K SLoC