Skip to content

Commit

Permalink
Remove test_ prefix from integration tests (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Oct 27, 2022
1 parent 33a958d commit 53e8b5e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 40 deletions.
Expand Up @@ -8,6 +8,10 @@ use shotover_proxy::transforms::cassandra::sink_cluster::{
};
use tokio::sync::{mpsc, watch};

pub mod multi_rack;
pub mod single_rack_v3;
pub mod single_rack_v4;

pub async fn run_topology_task(ca_path: Option<&str>, port: Option<u32>) -> Vec<CassandraNode> {
let port = port.unwrap_or(9042);
let (nodes_tx, mut nodes_rx) = watch::channel(vec![]);
Expand Down
54 changes: 24 additions & 30 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Expand Up @@ -24,12 +24,6 @@ mod batch_statements;
mod cache;
#[cfg(feature = "cassandra-cpp-driver-tests")]
mod cluster;
#[cfg(feature = "cassandra-cpp-driver-tests")]
mod cluster_multi_rack;
#[cfg(feature = "cassandra-cpp-driver-tests")]
mod cluster_single_rack_v3;
#[cfg(feature = "cassandra-cpp-driver-tests")]
mod cluster_single_rack_v4;
mod collections;
mod functions;
mod keyspace;
Expand Down Expand Up @@ -65,7 +59,7 @@ where
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_passthrough(#[case] driver: CassandraDriver) {
async fn passthrough_standard(#[case] driver: CassandraDriver) {
let _compose = DockerCompose::new("example-configs/cassandra-passthrough/docker-compose.yaml");

let _shotover_manager =
Expand All @@ -82,7 +76,7 @@ async fn test_passthrough(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_passthrough_encode(#[case] driver: CassandraDriver) {
async fn passthrough_encode(#[case] driver: CassandraDriver) {
let _compose = DockerCompose::new("example-configs/cassandra-passthrough/docker-compose.yaml");

let _shotover_manager = ShotoverManager::from_topology_file(
Expand All @@ -100,7 +94,7 @@ async fn test_passthrough_encode(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_source_tls_and_single_tls(#[case] driver: CassandraDriver) {
async fn source_tls_and_single_tls(#[case] driver: CassandraDriver) {
test_helpers::cert::generate_cassandra_test_certs();
let _compose = DockerCompose::new("example-configs/cassandra-tls/docker-compose.yaml");

Expand Down Expand Up @@ -132,7 +126,7 @@ async fn test_source_tls_and_single_tls(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_single_rack_v3(#[case] driver: CassandraDriver) {
async fn cluster_single_rack_v3(#[case] driver: CassandraDriver) {
let _compose =
DockerCompose::new("example-configs/cassandra-cluster/docker-compose-cassandra-v3.yaml");

Expand All @@ -149,14 +143,14 @@ async fn test_cluster_single_rack_v3(#[case] driver: CassandraDriver) {
connection
};
standard_test_suite(&connection, driver).await;
cluster_single_rack_v3::test_dummy_peers(&connection().await).await;
cluster::single_rack_v3::test_dummy_peers(&connection().await).await;
routing::test("127.0.0.1", 9042, "172.16.1.2", 9042).await;

//Check for bugs in cross connection state
native_types::test(&connection().await).await;
}

cluster_single_rack_v3::test_topology_task(None).await;
cluster::single_rack_v3::test_topology_task(None).await;
}

#[cfg(feature = "cassandra-cpp-driver-tests")]
Expand All @@ -165,7 +159,7 @@ async fn test_cluster_single_rack_v3(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_single_rack_v4(#[case] driver: CassandraDriver) {
async fn cluster_single_rack_v4(#[case] driver: CassandraDriver) {
let compose =
DockerCompose::new("example-configs/cassandra-cluster/docker-compose-cassandra-v4.yaml");

Expand All @@ -182,7 +176,7 @@ async fn test_cluster_single_rack_v4(#[case] driver: CassandraDriver) {
);

standard_test_suite(&connection, driver).await;
cluster_single_rack_v4::test(&connection().await).await;
cluster::single_rack_v4::test(&connection().await).await;

routing::test("127.0.0.1", 9042, "172.16.1.2", 9044).await;
//Check for bugs in cross connection state
Expand All @@ -198,14 +192,14 @@ async fn test_cluster_single_rack_v4(#[case] driver: CassandraDriver) {
"example-configs/cassandra-cluster/topology-dummy-peers-v4.yaml",
);

cluster_single_rack_v4::test_dummy_peers(&connection().await).await;
cluster::single_rack_v4::test_dummy_peers(&connection().await).await;
}

cluster_single_rack_v4::test_topology_task(None, Some(9044)).await;
cluster::single_rack_v4::test_topology_task(None, Some(9044)).await;

let shotover_manager =
ShotoverManager::from_topology_file("example-configs/cassandra-cluster/topology-v4.yaml");
cluster_single_rack_v4::test_node_going_down(compose, shotover_manager, driver).await;
cluster::single_rack_v4::test_node_going_down(compose, shotover_manager, driver).await;
}

#[cfg(feature = "cassandra-cpp-driver-tests")]
Expand All @@ -214,7 +208,7 @@ async fn test_cluster_single_rack_v4(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_multi_rack(#[case] driver: CassandraDriver) {
async fn cluster_multi_rack(#[case] driver: CassandraDriver) {
let _compose =
DockerCompose::new("example-configs/cassandra-cluster-multi-rack/docker-compose.yaml");

Expand All @@ -237,13 +231,13 @@ async fn test_cluster_multi_rack(#[case] driver: CassandraDriver) {
connection
};
standard_test_suite(&connection, driver).await;
cluster_multi_rack::test(&connection().await).await;
cluster::multi_rack::test(&connection().await).await;

//Check for bugs in cross connection state
native_types::test(&connection().await).await;
}

cluster_multi_rack::test_topology_task(None).await;
cluster::multi_rack::test_topology_task(None).await;
}

#[cfg(feature = "cassandra-cpp-driver-tests")]
Expand All @@ -252,7 +246,7 @@ async fn test_cluster_multi_rack(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_source_tls_and_cluster_tls(#[case] driver: CassandraDriver) {
async fn source_tls_and_cluster_tls(#[case] driver: CassandraDriver) {
test_helpers::cert::generate_cassandra_test_certs();
let ca_cert = "example-configs/docker-images/cassandra-tls-4.0.6/certs/localhost_CA.crt";

Expand Down Expand Up @@ -284,18 +278,18 @@ async fn test_source_tls_and_cluster_tls(#[case] driver: CassandraDriver) {
};

standard_test_suite(&connection, driver).await;
cluster_single_rack_v4::test(&connection().await).await;
cluster::single_rack_v4::test(&connection().await).await;
}

cluster_single_rack_v4::test_topology_task(Some(ca_cert), None).await;
cluster::single_rack_v4::test_topology_task(Some(ca_cert), None).await;
}

#[rstest]
#[case(CdrsTokio)]
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_redis_cache(#[case] driver: CassandraDriver) {
async fn cassandra_redis_cache(#[case] driver: CassandraDriver) {
let recorder = DebuggingRecorder::new();
let snapshotter = recorder.snapshotter();
recorder.install().unwrap();
Expand Down Expand Up @@ -326,7 +320,7 @@ async fn test_cassandra_redis_cache(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_protect_transform_local(#[case] driver: CassandraDriver) {
async fn protect_transform_local(#[case] driver: CassandraDriver) {
let _compose =
DockerCompose::new("example-configs/cassandra-protect-local/docker-compose.yaml");

Expand All @@ -348,7 +342,7 @@ async fn test_cassandra_protect_transform_local(#[case] driver: CassandraDriver)
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_protect_transform_aws(#[case] driver: CassandraDriver) {
async fn protect_transform_aws(#[case] driver: CassandraDriver) {
let _compose = DockerCompose::new("example-configs/cassandra-protect-aws/docker-compose.yaml");
let _compose_aws = DockerCompose::new_moto();

Expand All @@ -368,7 +362,7 @@ async fn test_cassandra_protect_transform_aws(#[case] driver: CassandraDriver) {
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_peers_rewrite_cassandra4(#[case] driver: CassandraDriver) {
async fn peers_rewrite_v4(#[case] driver: CassandraDriver) {
let _docker_compose = DockerCompose::new(
"tests/test-configs/cassandra-peers-rewrite/docker-compose-4.0-cassandra.yaml",
);
Expand Down Expand Up @@ -462,7 +456,7 @@ async fn test_cassandra_peers_rewrite_cassandra4(#[case] driver: CassandraDriver
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_peers_rewrite_cassandra3(#[case] driver: CassandraDriver) {
async fn peers_rewrite_v3(#[case] driver: CassandraDriver) {
let _docker_compose = DockerCompose::new(
"tests/test-configs/cassandra-peers-rewrite/docker-compose-3.11-cassandra.yaml",
);
Expand Down Expand Up @@ -494,7 +488,7 @@ async fn test_cassandra_peers_rewrite_cassandra3(#[case] driver: CassandraDriver
#[cfg_attr(feature = "cassandra-cpp-driver-tests", case(Datastax))]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cassandra_request_throttling(#[case] driver: CassandraDriver) {
async fn request_throttling(#[case] driver: CassandraDriver) {
let _docker_compose =
DockerCompose::new("example-configs/cassandra-passthrough/docker-compose.yaml");

Expand Down Expand Up @@ -589,7 +583,7 @@ async fn test_cassandra_request_throttling(#[case] driver: CassandraDriver) {
#[case(CdrsTokio)]
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_events_keyspace(#[case] driver: CassandraDriver) {
async fn events_keyspace(#[case] driver: CassandraDriver) {
let _docker_compose =
DockerCompose::new("example-configs/cassandra-passthrough/docker-compose.yaml");

Expand Down
20 changes: 10 additions & 10 deletions shotover-proxy/tests/redis_int_tests/mod.rs
Expand Up @@ -14,7 +14,7 @@ pub mod basic_driver_tests;

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_passthrough() {
async fn passthrough() {
let _compose = DockerCompose::new("example-configs/redis-passthrough/docker-compose.yaml");
let shotover_manager =
ShotoverManager::from_topology_file("example-configs/redis-passthrough/topology.yaml");
Expand All @@ -28,7 +28,7 @@ async fn test_passthrough() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_passthrough_redis_down() {
async fn passthrough_redis_down() {
let shotover_manager =
ShotoverManager::from_topology_file("example-configs/redis-passthrough/topology.yaml");
let mut connection = shotover_manager.redis_connection_async(6379).await;
Expand All @@ -40,7 +40,7 @@ async fn test_passthrough_redis_down() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_tls() {
async fn cluster_tls() {
test_helpers::cert::generate_redis_test_certs(Path::new("example-configs/redis-tls/certs"));

{
Expand Down Expand Up @@ -70,7 +70,7 @@ async fn test_cluster_tls() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_source_tls_and_single_tls() {
async fn source_tls_and_single_tls() {
test_helpers::cert::generate_redis_test_certs(Path::new("example-configs/redis-tls/certs"));

let _compose = DockerCompose::new("example-configs/redis-tls/docker-compose.yaml");
Expand Down Expand Up @@ -98,7 +98,7 @@ async fn test_source_tls_and_single_tls() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_ports_rewrite() {
async fn cluster_ports_rewrite() {
let _compose =
DockerCompose::new("tests/test-configs/redis-cluster-ports-rewrite/docker-compose.yaml");
let shotover_manager = ShotoverManager::from_topology_file(
Expand All @@ -117,7 +117,7 @@ async fn test_cluster_ports_rewrite() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_redis_multi() {
async fn multi() {
let _compose = DockerCompose::new("example-configs/redis-multi/docker-compose.yaml");
let shotover_manager =
ShotoverManager::from_topology_file("example-configs/redis-multi/topology.yaml");
Expand All @@ -130,7 +130,7 @@ async fn test_redis_multi() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_auth_redis() {
async fn cluster_auth() {
let _compose = DockerCompose::new("tests/test-configs/redis-cluster-auth/docker-compose.yaml");
let shotover_manager =
ShotoverManager::from_topology_file("tests/test-configs/redis-cluster-auth/topology.yaml");
Expand All @@ -142,7 +142,7 @@ async fn test_cluster_auth_redis() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_hiding_redis() {
async fn cluster_hiding() {
let _compose = DockerCompose::new("example-configs/redis-cluster-hiding/docker-compose.yaml");
let shotover_manager =
ShotoverManager::from_topology_file("example-configs/redis-cluster-hiding/topology.yaml");
Expand All @@ -158,7 +158,7 @@ async fn test_cluster_hiding_redis() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_handling_redis() {
async fn cluster_handling() {
let _compose = DockerCompose::new("example-configs/redis-cluster-handling/docker-compose.yaml");
let shotover_manager =
ShotoverManager::from_topology_file("example-configs/redis-cluster-handling/topology.yaml");
Expand All @@ -175,7 +175,7 @@ async fn test_cluster_handling_redis() {

#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn test_cluster_dr_redis() {
async fn cluster_dr() {
let _compose = DockerCompose::new("example-configs/redis-cluster-dr/docker-compose.yaml");

let nodes = vec![
Expand Down

0 comments on commit 53e8b5e

Please sign in to comment.