From 4923fc810867a3fc5ed86c807853a9921c8dc59e Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Thu, 8 Dec 2022 18:17:34 +1100 Subject: [PATCH] Remove unneeded cfg(not(feature...)) --- .../tests/cassandra_int_tests/mod.rs | 3 -- .../tests/cassandra_int_tests/routing.rs | 38 ++++++++++++------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/shotover-proxy/tests/cassandra_int_tests/mod.rs b/shotover-proxy/tests/cassandra_int_tests/mod.rs index 51dfde8a5..515a7cae1 100644 --- a/shotover-proxy/tests/cassandra_int_tests/mod.rs +++ b/shotover-proxy/tests/cassandra_int_tests/mod.rs @@ -30,7 +30,6 @@ mod prepared_statements_all; mod prepared_statements_simple; #[cfg(feature = "alpha-transforms")] mod protect; -#[cfg(not(feature = "cassandra-cpp-driver-tests"))] mod routing; mod table; mod timestamp; @@ -148,7 +147,6 @@ async fn cluster_single_rack_v3(#[case] driver: CassandraDriver) { standard_test_suite(&connection, driver).await; cluster::single_rack_v3::test_dummy_peers(&connection().await).await; - #[cfg(not(feature = "cassandra-cpp-driver-tests"))] routing::test("127.0.0.1", 9042, "172.16.1.2", 9042, driver).await; //Check for bugs in cross connection state @@ -183,7 +181,6 @@ async fn cluster_single_rack_v4(#[case] driver: CassandraDriver) { standard_test_suite(&connection, driver).await; cluster::single_rack_v4::test(&connection().await, driver).await; - #[cfg(not(feature = "cassandra-cpp-driver-tests"))] routing::test("127.0.0.1", 9042, "172.16.1.2", 9044, driver).await; //Check for bugs in cross connection state diff --git a/shotover-proxy/tests/cassandra_int_tests/routing.rs b/shotover-proxy/tests/cassandra_int_tests/routing.rs index 238c9882f..c781debaf 100644 --- a/shotover-proxy/tests/cassandra_int_tests/routing.rs +++ b/shotover-proxy/tests/cassandra_int_tests/routing.rs @@ -320,17 +320,29 @@ pub async fn test( cassandra_port: u16, driver: CassandraDriver, ) { - let mut shotover = - CassandraConnection::new(shotover_contact_point, shotover_port, driver).await; - shotover - .enable_schema_awaiter( - &format!("{}:{}", cassandra_contact_point, cassandra_port), - None, - ) - .await; - let cassandra = CassandraConnection::new(cassandra_contact_point, cassandra_port, driver).await; - - single_key::test(&shotover, &cassandra).await; - composite_key::test(&shotover, &cassandra).await; - compound_key::test(&shotover, &cassandra).await; + #[cfg(feature = "cassandra-cpp-driver-tests")] + let run = if let CassandraDriver::Datastax = driver { + false + } else { + true + }; + #[cfg(not(feature = "cassandra-cpp-driver-tests"))] + let run = true; + + if run { + let mut shotover = + CassandraConnection::new(shotover_contact_point, shotover_port, driver).await; + shotover + .enable_schema_awaiter( + &format!("{}:{}", cassandra_contact_point, cassandra_port), + None, + ) + .await; + let cassandra = + CassandraConnection::new(cassandra_contact_point, cassandra_port, driver).await; + + single_key::test(&shotover, &cassandra).await; + composite_key::test(&shotover, &cassandra).await; + compound_key::test(&shotover, &cassandra).await; + } }