💚 Removed unused duplicated function
Some checks failed
Build & test / build (push) Failing after 10m43s
Some checks failed
Build & test / build (push) Failing after 10m43s
This commit is contained in:
parent
f14543af6b
commit
d84078d6c3
@ -1,19 +1,11 @@
|
|||||||
use diesel_migrations::EmbeddedMigrations;
|
use diesel_migrations::EmbeddedMigrations;
|
||||||
use lib::diesel::migration::run_migrations;
|
use lib::diesel::migration::run_migrations;
|
||||||
use lib::test::test_containers::{ContainerError, TestContainer};
|
use lib::test::test_containers::{ContainerError, TestContainer};
|
||||||
use testcontainers_modules::postgres::Postgres;
|
|
||||||
use testcontainers_modules::testcontainers::runners::AsyncRunner;
|
|
||||||
use testcontainers_modules::testcontainers::{ContainerAsync, TestcontainersError};
|
|
||||||
|
|
||||||
pub async fn create_test_containers_pool() -> Result<TestContainer, ContainerError> {
|
pub async fn create_test_containers_pool() -> Result<TestContainer, ContainerError> {
|
||||||
let test_container = lib::test::test_containers::create_test_containers_pool().await?;
|
let test_container = lib::test::test_containers::create_test_containers_pool().await?;
|
||||||
let pool = &test_container.pool;
|
let connection = test_container.pool.get().await?;
|
||||||
let connection = pool.get().await?;
|
|
||||||
const MIGRATIONS: EmbeddedMigrations = diesel_migrations::embed_migrations!("./migrations");
|
const MIGRATIONS: EmbeddedMigrations = diesel_migrations::embed_migrations!("./migrations");
|
||||||
run_migrations(connection, MIGRATIONS).await?;
|
run_migrations(connection, MIGRATIONS).await?;
|
||||||
Ok(test_container)
|
Ok(test_container)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn create_postgres_container() -> Result<ContainerAsync<Postgres>, TestcontainersError> {
|
|
||||||
Postgres::default().start().await
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user