From 8591385ef288617100f046eea16f025e6de2ba09 Mon Sep 17 00:00:00 2001 From: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> Date: Thu, 28 Mar 2024 17:13:37 +0900 Subject: [PATCH] add #![cfg(any(feature ...))], to reduce warning in cargo test --- tests/connection_tests.rs | 5 +++++ tests/cursor_tests.rs | 5 +++++ tests/json_vec_tests.rs | 2 +- tests/loader_tests.rs | 5 +++++ tests/partial_model_tests.rs | 5 +++++ tests/pi_tests.rs | 5 +++++ tests/relational_tests.rs | 5 +++++ tests/returning_tests.rs | 5 +++++ tests/self_join_tests.rs | 5 +++++ tests/sequential_op_tests.rs | 5 +++++ tests/time_crate_tests.rs | 5 +++++ tests/transaction_tests.rs | 5 +++++ 12 files changed, 56 insertions(+), 1 deletion(-) diff --git a/tests/connection_tests.rs b/tests/connection_tests.rs index f75c588fc..ac0a1527c 100644 --- a/tests/connection_tests.rs +++ b/tests/connection_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; diff --git a/tests/cursor_tests.rs b/tests/cursor_tests.rs index 0b652d751..488818f82 100644 --- a/tests/cursor_tests.rs +++ b/tests/cursor_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{features::*, setup::*, TestContext}; diff --git a/tests/json_vec_tests.rs b/tests/json_vec_tests.rs index 08ccdd281..d26e166b6 100644 --- a/tests/json_vec_tests.rs +++ b/tests/json_vec_tests.rs @@ -86,7 +86,7 @@ pub async fn insert_json_struct_vec_derive(db: &DatabaseConnection) -> Result<() ], }; - let result = json_vec.clone().into_active_model().insert(db).await?; + let _result = json_vec.clone().into_active_model().insert(db).await?; let model = json_vec_derive::json_struct_vec::Entity::find() .filter(json_vec_derive::json_struct_vec::Column::Id.eq(json_vec.id)) diff --git a/tests/loader_tests.rs b/tests/loader_tests.rs index 49eea14ed..e11bb3252 100644 --- a/tests/loader_tests.rs +++ b/tests/loader_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; diff --git a/tests/partial_model_tests.rs b/tests/partial_model_tests.rs index 10407c22e..f59747ba6 100644 --- a/tests/partial_model_tests.rs +++ b/tests/partial_model_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] use entity::{Column, Entity}; use sea_orm::{ColumnTrait, DerivePartialModel, EntityTrait, FromQueryResult, ModelTrait}; use sea_query::Expr; diff --git a/tests/pi_tests.rs b/tests/pi_tests.rs index e62bf7e33..299380c93 100644 --- a/tests/pi_tests.rs +++ b/tests/pi_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; use common::{features::*, setup::*, TestContext}; diff --git a/tests/relational_tests.rs b/tests/relational_tests.rs index 64243c94d..8d22b1d98 100644 --- a/tests/relational_tests.rs +++ b/tests/relational_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use chrono::offset::Utc; diff --git a/tests/returning_tests.rs b/tests/returning_tests.rs index d653f379d..536cba0bf 100644 --- a/tests/returning_tests.rs +++ b/tests/returning_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; diff --git a/tests/self_join_tests.rs b/tests/self_join_tests.rs index 6c8d961e7..1191b63d0 100644 --- a/tests/self_join_tests.rs +++ b/tests/self_join_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{features::*, setup::*, TestContext}; diff --git a/tests/sequential_op_tests.rs b/tests/sequential_op_tests.rs index bc7126dfe..c3adb9daa 100644 --- a/tests/sequential_op_tests.rs +++ b/tests/sequential_op_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use chrono::offset::Utc; diff --git a/tests/time_crate_tests.rs b/tests/time_crate_tests.rs index 0642ca01d..f29e2c873 100644 --- a/tests/time_crate_tests.rs +++ b/tests/time_crate_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{features::*, setup::*, TestContext}; use pretty_assertions::assert_eq; diff --git a/tests/transaction_tests.rs b/tests/transaction_tests.rs index b643cc3be..00c5d7d28 100644 --- a/tests/transaction_tests.rs +++ b/tests/transaction_tests.rs @@ -1,3 +1,8 @@ +#![cfg(any( + feature = "sqlx-mysql", + feature = "sqlx-sqlite", + feature = "sqlx-postgres" +))] pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext};