21 releases (13 breaking)

Uses new Rust 2024

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

#391 in Testing

Download history 3/week @ 2025-11-13 15/week @ 2025-11-20 11/week @ 2025-11-27 3/week @ 2025-12-04 28/week @ 2026-01-01 73/week @ 2026-01-08 47/week @ 2026-01-15 144/week @ 2026-01-22 65/week @ 2026-01-29 85/week @ 2026-02-05 127/week @ 2026-02-12 41/week @ 2026-02-19

320 downloads per month

MIT license

30KB
87 lines

Unofficial Rust Test Container For Redpanda

github action Crates.io Crates.io

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.x supports testcontainers 0.27
  • 0.13.x supports testcontainers 0.26
  • 0.12.x supports testcontainers 0.25
  • 0.11.x supports testcontainers 0.24
  • 0.10.x supports testcontainers 0.23

Dependencies

~24–43MB
~569K SLoC