Comments.
Coverage to Makefile.toml. Added branch to map! to allow for instantiating with default values.
This commit is contained in:
@ -3,13 +3,15 @@ use diesel_async::pooled_connection::deadpool::{BuildError, PoolError};
|
||||
use diesel_async::AsyncPgConnection;
|
||||
use diesel_async_migrations::EmbeddedMigrations;
|
||||
use lib::diesel::pool::{create_pool_from_url, PgPool};
|
||||
use lib::diesel::DieselError;
|
||||
use testcontainers_modules::postgres::Postgres;
|
||||
use testcontainers_modules::testcontainers::runners::AsyncRunner;
|
||||
use testcontainers_modules::testcontainers::{ContainerAsync, TestcontainersError};
|
||||
|
||||
/// When the TestContainer is dropped, the container will be removed.
|
||||
/// # Panics
|
||||
/// If destructed and the container field is dropped, the container will be removed, and using the pool will cause panic.
|
||||
/// # Errors
|
||||
/// If destructed and the container field is dropped, the container will be stopped
|
||||
/// and all connections from the pool will result in DatabaseError.
|
||||
#[derive(Constructor)]
|
||||
pub struct TestContainer {
|
||||
pub container: ContainerAsync<Postgres>,
|
||||
@ -21,7 +23,7 @@ pub enum ContainerError {
|
||||
TestContainers(TestcontainersError),
|
||||
BuildError(BuildError),
|
||||
PoolError(PoolError),
|
||||
DieselError(diesel::result::Error),
|
||||
DieselError(DieselError),
|
||||
}
|
||||
|
||||
pub async fn create_test_containers_pool<'a>() -> Result<TestContainer, ContainerError> {
|
||||
|
Reference in New Issue
Block a user