Skip to content

Commit 585e633

Browse files
authored
chore(ci): Cube store - validate all subcrates + benches (#9907)
1 parent 983d574 commit 585e633

File tree

4 files changed

+60
-29
lines changed

4 files changed

+60
-29
lines changed

.github/workflows/rust-cubestore-master.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ jobs:
4141
workspaces: ./rust/cubestore -> target
4242
shared-key: cubestore
4343
key: ubuntu-22.04
44-
- name: Run cargo fmt cubestore
45-
run: |
46-
cargo fmt --manifest-path rust/cubestore/cubestore/Cargo.toml -- --check
47-
- name: Run cargo fmt cubehll
48-
run: |
49-
cargo fmt --manifest-path rust/cubestore/cubehll/Cargo.toml -- --check
50-
- name: Run cargo build
51-
run:
52-
cargo build --manifest-path rust/cubestore/Cargo.toml -j 4
44+
- name: Run cargo fmt
45+
run: cargo fmt --check
46+
working-directory: rust/cubestore
47+
- name: Run cargo check
48+
# Re-using test profile to speedup builds
49+
run: cargo check --benches --profile test
50+
working-directory: rust/cubestore
5351
- name: Run cargo test
5452
env:
5553
CUBESTORE_AWS_ACCESS_KEY_ID: ${{ secrets.CUBESTORE_AWS_ACCESS_KEY_ID }}
@@ -58,8 +56,8 @@ jobs:
5856
TEST_KSQL_USER: ${{ secrets.TEST_KSQL_USER }}
5957
TEST_KSQL_PASS: ${{ secrets.TEST_KSQL_PASS }}
6058
TEST_KSQL_URL: ${{ secrets.TEST_KSQL_URL }}
61-
run: |
62-
cargo test --manifest-path rust/cubestore/Cargo.toml -j 1
59+
run: cargo test -- --test-threads=1
60+
working-directory: rust/cubestore
6361

6462
cubestore-docker-image-dev:
6563
name: Release Cube Store :dev image

.github/workflows/rust-cubestore.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,21 @@ jobs:
5050
# We should use a separate key for testing to pass disk space limitations
5151
shared-key: cubestore-testing
5252
key: ubuntu-22.04
53-
- name: Run cargo fmt cubestore
54-
run: |
55-
cargo fmt --manifest-path rust/cubestore/cubestore/Cargo.toml -- --check
56-
- name: Run cargo fmt cubehll
57-
run: |
58-
cargo fmt --manifest-path rust/cubestore/cubehll/Cargo.toml -- --check
59-
- name: Run cargo build
60-
run: |
61-
cargo build --manifest-path rust/cubestore/Cargo.toml
53+
- name: Run cargo fmt
54+
run: cargo fmt --check
55+
working-directory: rust/cubestore
56+
- name: Run cargo check
57+
# Re-using test profile to speedup builds
58+
run: cargo check --benches --profile test
59+
working-directory: rust/cubestore
6260
- name: Run cargo test
6361
env:
6462
# LocalDirRemoteFs expect that std::env::temp_dir and its local dir is on same FS, to use `rename`
6563
# On Unix it's controlled by TMPDIR
6664
# When using `container` in GHA checkout will be located in `/__w`, and that's a separate mount from `/tmp`
6765
TMPDIR: /__w/tmp
68-
run: |
69-
cargo test --manifest-path rust/cubestore/Cargo.toml
66+
run: cargo test -- --test-threads=1
67+
working-directory: rust/cubestore
7068

7169
docker-image-latest:
7270
name: Build only :latest image

rust/cubestore/cubestore-sql-tests/src/lib.rs

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use async_trait::async_trait;
77
use cubestore::sql::{QueryPlans, SqlQueryContext, SqlService};
88
use cubestore::store::DataFrame;
99
use cubestore::CubeError;
10-
use std::env;
10+
use std::env::args;
1111
use std::panic::RefUnwindSafe;
1212
use std::sync::Arc;
1313
use test::TestFn::DynTestFn;
@@ -65,11 +65,19 @@ pub fn run_sql_tests(
6565
})
6666
.collect();
6767

68-
test::test_main(
69-
&env::args().chain(extra_args).collect::<Vec<String>>(),
70-
tests,
71-
None,
72-
);
68+
test::test_main(&merge_args(args().collect(), extra_args), tests, None);
69+
}
70+
71+
fn merge_args(mut base: Vec<String>, extra: Vec<String>) -> Vec<String> {
72+
for extra_arg in extra.into_iter() {
73+
if let Some((arg_name, _arg_value)) = extra_arg.split_once('=') {
74+
base.retain(|a| !a.starts_with(arg_name));
75+
}
76+
77+
base.push(extra_arg.to_string());
78+
}
79+
80+
base
7381
}
7482

7583
#[async_trait]
@@ -90,3 +98,30 @@ impl SqlClient for Arc<dyn SqlService> {
9098
self.as_ref().plan_query(query).await
9199
}
92100
}
101+
102+
#[cfg(test)]
103+
mod test_helpers {
104+
use super::*;
105+
106+
#[test]
107+
fn test_merge_args() {
108+
let base = vec![
109+
"path/to/executable".to_string(),
110+
"--test-threads=1".to_string(),
111+
];
112+
let extra = vec![
113+
"--test-threads=2".to_string(),
114+
"--skip=planning_inplace_aggregate2".to_string(),
115+
];
116+
117+
let merged = merge_args(base, extra);
118+
assert_eq!(
119+
merged,
120+
vec![
121+
"path/to/executable",
122+
"--test-threads=2",
123+
"--skip=planning_inplace_aggregate2"
124+
]
125+
);
126+
}
127+
}

rust/cubestore/cubestore/benches/cachestore_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn do_benches(c: &mut Criterion) {
227227
do_list_bench(c, &runtime, Some(QueueItemStatus::Pending), 1_000, 128, 128);
228228
do_list_bench(c, &runtime, Some(QueueItemStatus::Active), 1_000, 128, 128);
229229

230-
do_get_bench(c, &runtime, 2_500, 128, 128, 4na);
230+
do_get_bench(c, &runtime, 2_500, 128, 128, 4);
231231
}
232232

233233
criterion_group!(benches, do_benches);

0 commit comments

Comments
 (0)