-
Notifications
You must be signed in to change notification settings - Fork 129
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
base: main
Are you sure you want to change the base?
Backport ccm main #1296
Changes from 1 commit
8ba3fc3
7a34172
6215b08
7a38b56
41e26cf
dbbecb7
d6f3fb2
2b0c18c
a02254c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
@@ -103,4 +106,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [ | |
'cfg(scylla_cloud_tests)', | ||
'cfg(cassandra_tests)', | ||
'cfg(cpp_rust_unstable)', | ||
'cfg(ccm_tests)', | ||
] } |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
There was a problem hiding this comment.
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?