diff --git a/tests/bakery_chain_tests.rs b/tests/bakery_chain_tests.rs index bae125e5..8c52ca2a 100644 --- a/tests/bakery_chain_tests.rs +++ b/tests/bakery_chain_tests.rs @@ -7,6 +7,7 @@ mod crud; // cargo test --test bakery_chain_tests -- --nocapture #[async_std::test] +#[cfg(feature = "sqlx-mysql")] async fn main() { let base_url = "mysql://root:@localhost"; let db_name = "bakery_chain_schema_crud_tests"; diff --git a/tests/query_tests.rs b/tests/query_tests.rs index 65775a5e..466b7b3b 100644 --- a/tests/query_tests.rs +++ b/tests/query_tests.rs @@ -6,6 +6,7 @@ pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_one_with_no_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_one_with_no_result").await; @@ -16,6 +17,7 @@ pub async fn find_one_with_no_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_one_with_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_one_with_result").await; @@ -36,6 +38,7 @@ pub async fn find_one_with_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_by_id_with_no_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_by_id_with_no_result").await; @@ -46,6 +49,7 @@ pub async fn find_by_id_with_no_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_by_id_with_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_by_id_with_result").await; @@ -70,6 +74,7 @@ pub async fn find_by_id_with_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_all_with_no_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_all_with_no_result").await; @@ -80,6 +85,7 @@ pub async fn find_all_with_no_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_all_with_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_all_with_result").await; @@ -109,6 +115,7 @@ pub async fn find_all_with_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_all_filter_no_result() { let ctx = TestContext::new("mysql://root:@localhost", "find_all_filter_no_result").await; @@ -142,6 +149,7 @@ pub async fn find_all_filter_no_result() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn find_all_filter_with_results() { let ctx = TestContext::new("mysql://root:@localhost", "find_all_filter_with_results").await; diff --git a/tests/relational_tests.rs b/tests/relational_tests.rs index 33c43659..3e019473 100644 --- a/tests/relational_tests.rs +++ b/tests/relational_tests.rs @@ -9,6 +9,7 @@ pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn left_join() { let ctx = TestContext::new("mysql://root:@localhost", "test_left_join").await; @@ -85,6 +86,7 @@ pub async fn left_join() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn right_join() { let ctx = TestContext::new("mysql://root:@localhost", "test_right_join").await; @@ -165,6 +167,7 @@ pub async fn right_join() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn inner_join() { let ctx = TestContext::new("mysql://root:@localhost", "test_inner_join").await; @@ -249,6 +252,7 @@ pub async fn inner_join() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn group_by() { let ctx = TestContext::new("mysql://root:@localhost", "test_group_by").await; @@ -348,6 +352,7 @@ pub async fn group_by() { } #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn having() { // customers with orders with total equal to $90 let ctx = TestContext::new("mysql://root:@localhost", "test_having").await; diff --git a/tests/sequential_op_tests.rs b/tests/sequential_op_tests.rs index 1630e4c6..2e703c64 100644 --- a/tests/sequential_op_tests.rs +++ b/tests/sequential_op_tests.rs @@ -8,6 +8,7 @@ pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; #[async_std::test] +#[cfg(feature = "sqlx-mysql")] pub async fn test_multiple_operations() { let ctx = TestContext::new("mysql://root:@localhost", "multiple_sequential_operations").await;