Skip to content

anas-contribs/testcontainers-redpanda-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial Rust Test Container For Redpanda

github action Crates.io Crates.io

Unofficial testcontainer for Redpanda.

Add dependency:

testcontainers-redpanda-rs = "0.1"

Create and run redpanda container:

use testcontainers::clients;
use testcontainers_redpanda_rs::*;

let docker = clients::Cli::default();
let container = Redpanda::latest();
let redpanda_node = docker.run(container);

// Auto create topic is enabled by default,
// use this if you need to create a topic with 
// specific number of partitions. 
redpanda_node.exec(Redpanda::cmd_create_topic("new_topic", 3));

let redpanda_server_address = format!("localhost:{}", redpanda_node.get_host_port_ipv4(REDPANDA_PORT));

println!("Redpanda server: {}", redpanda_server_address);

Current limitations:

  • It will use default kafka ports and only one test can at any time on given host. It was too complicated getting it right.

About

Rust Redpanda Testcontainer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%