1
0
mirror of https://github.com/actix/examples synced 2025-04-22 08:34:52 +02:00

fix(tests): ignore tests if postgres isn't up

This commit is contained in:
Alex Ted 2025-02-28 12:17:26 +03:00
parent c8da70bb0a
commit 9a25c3b233
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,9 @@ name = "db-diesel-async"
version = "1.0.0"
edition = "2021"
[features]
postgres_tests = []
[dependencies]
actix-web.workspace = true
diesel = { version = "2", default-features = false, features = ["uuid"] }

View File

@ -106,7 +106,8 @@ async fn initialize_db_pool() -> DbPool {
Pool::builder().build(connection_manager).await.unwrap()
}
#[cfg(test)]
#[cfg(not(feature = "postgres_tests"))]
#[allow(unused_imports)]
mod tests {
use actix_web::{http::StatusCode, test};
use diesel::prelude::*;