Skip to content

Commit

Permalink
fix(tests): ignore tests if postgres isn't up
Browse files Browse the repository at this point in the history
  • Loading branch information
alexted committed Feb 28, 2025
1 parent c8da70b commit 9a25c3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions databases/diesel-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
3 changes: 2 additions & 1 deletion databases/diesel-async/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down

0 comments on commit 9a25c3b

Please sign in to comment.