-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add CrateDB
module
#236
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution 🚀 |
9e3a39f
to
96a47ef
Compare
96a47ef
to
eb73284
Compare
Seems like rustfmt is still failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for the late reviews.
I usually would not review so late in the cycle, but I think the docs currently would not work as you intended.
/// super_user: crate | ||
/// password: <empty> | ||
/// pg_port: 5432 | ||
/// http_port: 4200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// super_user: crate | |
/// password: <empty> | |
/// pg_port: 5432 | |
/// http_port: 4200 | |
/// - `super_user`: `crate` | |
/// - `password`: <empty> | |
/// - `pg_port`: `5432` | |
/// - `http_port`: `4200` |
/// use testcontainers_modules::{postgres, testcontainers::runners::SyncRunner}; | ||
/// | ||
/// let postgres_instance = cratedb::CrateDB::default().start().unwrap(); | ||
/// | ||
/// let connection_string = format!( | ||
/// "postgres://crate@{}:{}/postgres", | ||
/// postgres_instance.get_host().unwrap(), | ||
/// postgres_instance.get_host_port_ipv4(5432).unwrap() | ||
/// ); | ||
/// | ||
/// let mut conn = postgres::Client::connect(connection_string, postgres::NoTls).unwrap(); | ||
/// let rows = conn.query("SELECT 1 + 1", &[]).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, this is not a doctest
/// use testcontainers_modules::{postgres, testcontainers::runners::SyncRunner}; | |
/// | |
/// let postgres_instance = cratedb::CrateDB::default().start().unwrap(); | |
/// | |
/// let connection_string = format!( | |
/// "postgres://crate@{}:{}/postgres", | |
/// postgres_instance.get_host().unwrap(), | |
/// postgres_instance.get_host_port_ipv4(5432).unwrap() | |
/// ); | |
/// | |
/// let mut conn = postgres::Client::connect(connection_string, postgres::NoTls).unwrap(); | |
/// let rows = conn.query("SELECT 1 + 1", &[]).unwrap(); | |
/// ``` | |
/// use testcontainers_modules::{postgres, testcontainers::runners::SyncRunner}; | |
/// | |
/// let postgres_instance = cratedb::CrateDB::default().start().unwrap(); | |
/// | |
/// let connection_string = format!( | |
/// "postgres://crate@{}:{}/postgres", | |
/// postgres_instance.get_host().unwrap(), | |
/// postgres_instance.get_host_port_ipv4(5432).unwrap() | |
/// ); | |
/// | |
/// let mut conn = postgres::Client::connect(connection_string, postgres::NoTls).unwrap(); | |
/// let rows = conn.query("SELECT 1 + 1", &[]).unwrap(); | |
/// # assert_eq!(rows.len(), 1); | |
/// ``` |
} | ||
|
||
impl CrateDB { | ||
/// Sets CrateDB's heap size, only increase it if you are testing big high volumes of data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Sets CrateDB's heap size, only increase it if you are testing big high volumes of data. | |
/// Sets CrateDB's heap size | |
/// | |
/// You may need to increase this if you are testing high volumes of data. |
} | ||
|
||
fn copy_to_sources(&self) -> impl IntoIterator<Item = &CopyToContainer> { | ||
&self.copy_to_sources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never set to anything other than Vec::new
... Is this intentional?
|
||
use super::*; | ||
use testcontainers::{runners::SyncRunner, ImageExt}; | ||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the linting issue raised by rustfmt
use super::*; | |
use testcontainers::{runners::SyncRunner, ImageExt}; | |
#[test] | |
use super::*; | |
use crate::testcontainers::{runners::SyncRunner, ImageExt}; | |
#[test] |
Solves #198
cc @kneth