Skip to content

Commit

Permalink
cassandra 5 single tests (#1454)
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbros authored Feb 9, 2024
1 parent bd7fbe8 commit 78c6960
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
26 changes: 26 additions & 0 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion test-helpers/src/docker_compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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),
},
];

0 comments on commit 78c6960

Please sign in to comment.