Skip to content

Backport ccm main #1296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ num-bigint-04 = { package = "num-bigint", version = "0.4" }
bigdecimal-04 = { package = "bigdecimal", version = "0.4" }
scylla-proxy = { version = "0.0.3", path = "../scylla-proxy" }
ntest = "0.9.3"
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
tokio = { version = "1.34", features = ["test-util"] }
criterion = "0.4" # Note: v0.5 needs at least rust 1.70.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📌 maybe let's bump it, as now we can?

tokio = { version = "1.34", features = ["test-util", "process", "fs"] }
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
assert_matches = "1.5.0"
rand_chacha = "0.9.0"
time = "0.3"
anyhow = "1"
tempfile = "3"
Comment on lines +93 to +94
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 As you mentioned elsewhere @Lorak-mmk, omitting minor number can result in build problems in some scenarios. Let's write minors explicitly.



[[bench]]
name = "benchmark"
Expand All @@ -103,4 +106,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(scylla_cloud_tests)',
'cfg(cassandra_tests)',
'cfg(cpp_rust_unstable)',
'cfg(ccm_tests)',
] }
65 changes: 65 additions & 0 deletions scylla/tests/integration/ccm/example.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
use std::sync::Arc;

use crate::ccm::lib::cluster::{Cluster, ClusterOptions};
use crate::ccm::lib::{run_ccm_test, CLUSTER_VERSION};
use crate::utils::setup_tracing;

use tokio::sync::Mutex;
use tracing::debug;

fn cluster_1_node() -> ClusterOptions {
ClusterOptions {
name: "cluster_1_node".to_string(),
version: CLUSTER_VERSION.clone(),
nodes: vec![1],
..ClusterOptions::default()
}
}

#[tokio::test]
#[cfg_attr(not(ccm_tests), ignore)]
async fn test_cluster_lifecycle1() {
setup_tracing();
async fn test(cluster: Arc<Mutex<Cluster>>) {
let cluster = cluster.lock().await;
let session = cluster.make_session_builder().await.build().await.unwrap();

let rows = session
.query_unpaged("select data_center from system.local", &[])
.await
.expect("failed to execute query")
.into_rows_result()
.expect("failed to get rows")
.rows::<(String,)>()
.expect("failed to deserialize rows")
.map(|res| res.map(|row| row.0))
.collect::<Result<Vec<_>, _>>()
.unwrap();
debug!("{:?}", rows);
}
run_ccm_test(cluster_1_node, test).await;
}

#[tokio::test]
#[cfg_attr(not(ccm_tests), ignore)]
async fn test_cluster_lifecycle2() {
setup_tracing();
async fn test(cluster: Arc<Mutex<Cluster>>) {
let cluster = cluster.lock().await;
let session = cluster.make_session_builder().await.build().await.unwrap();

let rows = session
.query_unpaged("select data_center from system.local", &[])
.await
.expect("failed to execute query")
.into_rows_result()
.expect("failed to get rows")
.rows::<(String,)>()
.expect("failed to deserialize rows")
.map(|res| res.map(|row| row.0))
.collect::<Result<Vec<_>, _>>()
.unwrap();
debug!("{:?}", rows);
}
run_ccm_test(cluster_1_node, test).await;
}
Comment on lines +19 to +65
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is there any difference between these two tests? I can't find any.

Loading