21 releases (13 breaking)
Uses new Rust 2024
| new 0.14.0 | Feb 8, 2026 |
|---|---|
| 0.13.0 | Dec 14, 2025 |
| 0.12.0 | Jul 30, 2025 |
| 0.10.2 | Feb 10, 2025 |
| 0.1.1 | Nov 15, 2023 |
#406 in Testing
335 downloads per month
30KB
87 lines
Unofficial Rust Test Container For Redpanda
Unofficial testcontainer for Redpanda. Redpanda is a simple, powerful, and cost-efficient streaming data platform that is compatible with Kafka APIs but much less complex, faster and more affordable.
Add dependency:
testcontainers-redpanda-rs = { version = "0.14" }
Create and run redpanda container:
use testcontainers_redpanda_rs::*;
#[tokio::main]
async fn main() {
let container = Redpanda::default();
let server_node = container.start().await.unwrap();
let bootstrap_servers = format!("localhost:{}", server_node.get_host_port_ipv4(REDPANDA_PORT).await.unwrap());
// if topic has only one partition this part is optional
// it will be automatically created when client connects
server_node.exec(Redpanda::cmd_create_topic("test_topic", 3)).await.unwrap();
println!("Redpanda server: {}", bootstrap_servers);
}
Explicit dependency on testcontainers is not needed.
Note about version compatibility:
0.14.xsupportstestcontainers0.270.13.xsupportstestcontainers0.260.12.xsupportstestcontainers0.250.11.xsupportstestcontainers0.240.10.xsupportstestcontainers0.23
Dependencies
~25–43MB
~578K SLoC