diff --git a/shotover-proxy/tests/cassandra_int_tests/batch_statements.rs b/shotover-proxy/tests/cassandra_int_tests/batch_statements.rs index e8668548e..422efec48 100644 --- a/shotover-proxy/tests/cassandra_int_tests/batch_statements.rs +++ b/shotover-proxy/tests/cassandra_int_tests/batch_statements.rs @@ -11,7 +11,7 @@ async fn large_batch(connection: &CassandraConnection) { let random_bytes = rand::thread_rng().gen::<[u8; 32]>(); let mut queries = Vec::new(); - for id in 0..1000 { + for id in 0..500 { let statement = format!( "INSERT INTO batch_keyspace.my_table (id, data) VALUES ({}, 0x{})", id, diff --git a/shotover-proxy/tests/cassandra_int_tests/mod.rs b/shotover-proxy/tests/cassandra_int_tests/mod.rs index 729cec3a8..fcc86b699 100644 --- a/shotover-proxy/tests/cassandra_int_tests/mod.rs +++ b/shotover-proxy/tests/cassandra_int_tests/mod.rs @@ -1011,3 +1011,29 @@ async fn passthrough_tls_websockets() { shotover.shutdown_and_then_consume_events(&[]).await; } + +#[apply(all_cassandra_drivers)] +#[tokio::test(flavor = "multi_thread")] +async fn cassandra_5(#[case] driver: CassandraDriver) { + let _compose = docker_compose("tests/test-configs/cassandra/cassandra-5/docker-compose.yaml"); + + let shotover = shotover_process("tests/test-configs/cassandra/cassandra-5/topology.yaml") + .start() + .await; + + let connection_creator = || CassandraConnectionBuilder::new("127.0.0.1", 9042, driver).build(); + + let connection = connection_creator().await; + + keyspace::test(&connection).await; + table::test(&connection).await; + udt::test(&connection).await; + native_types::test(&connection).await; + collections::test(&connection, driver).await; + prepared_statements_simple::test(&connection, connection_creator, 1).await; + prepared_statements_all::test(&connection, 1).await; + batch_statements::test(&connection).await; + timestamp::test(&connection).await; + + shotover.shutdown_and_then_consume_events(&[]).await; +} diff --git a/shotover-proxy/tests/test-configs/cassandra/cassandra-5/docker-compose.yaml b/shotover-proxy/tests/test-configs/cassandra/cassandra-5/docker-compose.yaml new file mode 100644 index 000000000..a2fcaf055 --- /dev/null +++ b/shotover-proxy/tests/test-configs/cassandra/cassandra-5/docker-compose.yaml @@ -0,0 +1,14 @@ +version: "3.3" +services: + cassandra-one: + image: shotover/cassandra-test:5.0-beta1-r2 + ports: + - "9043:9042" + environment: + MAX_HEAP_SIZE: "400M" + MIN_HEAP_SIZE: "400M" + HEAP_NEWSIZE: "48M" + USER_DEFINED_FUNCTIONS_ENABLED: "true" + volumes: + - type: tmpfs + target: /var/lib/cassandra diff --git a/shotover-proxy/tests/test-configs/cassandra/cassandra-5/topology.yaml b/shotover-proxy/tests/test-configs/cassandra/cassandra-5/topology.yaml new file mode 100644 index 000000000..6cdcc5627 --- /dev/null +++ b/shotover-proxy/tests/test-configs/cassandra/cassandra-5/topology.yaml @@ -0,0 +1,9 @@ +--- +sources: + - Cassandra: + name: "cassandra" + listen_addr: "127.0.0.1:9042" + chain: + - CassandraSinkSingle: + remote_address: "127.0.0.1:9043" + connect_timeout_ms: 3000 diff --git a/test-helpers/src/docker_compose.rs b/test-helpers/src/docker_compose.rs index c15291c30..ca8354cdf 100644 --- a/test-helpers/src/docker_compose.rs +++ b/test-helpers/src/docker_compose.rs @@ -27,7 +27,7 @@ pub fn new_moto() -> DockerCompose { docker_compose("tests/transforms/docker-compose-moto.yaml") } -pub static IMAGE_WAITERS: [Image; 10] = [ +pub static IMAGE_WAITERS: [Image; 11] = [ Image { name: "motoserver/moto", log_regex_to_wait_for: r"Press CTRL\+C to quit", @@ -80,4 +80,9 @@ pub static IMAGE_WAITERS: [Image; 10] = [ log_regex_to_wait_for: r"Node started", timeout: Duration::from_secs(120), }, + Image { + name: "shotover/cassandra-test:5.0-beta1-r2", + log_regex_to_wait_for: r"Starting listening for CQL clients", + timeout: Duration::from_secs(120), + }, ];