Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 9 additions & 11 deletions .github/workflows/rust-cubestore-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ jobs:
workspaces: ./rust/cubestore -> target
shared-key: cubestore
key: ubuntu-22.04
- name: Run cargo fmt cubestore
run: |
cargo fmt --manifest-path rust/cubestore/cubestore/Cargo.toml -- --check
- name: Run cargo fmt cubehll
run: |
cargo fmt --manifest-path rust/cubestore/cubehll/Cargo.toml -- --check
- name: Run cargo build
run:
cargo build --manifest-path rust/cubestore/Cargo.toml -j 4
- name: Run cargo fmt
run: cargo fmt --check
working-directory: rust/cubestore
- name: Run cargo check
# Re-using test profile to speedup builds
run: cargo check --benches --profile test
working-directory: rust/cubestore
- name: Run cargo test
env:
CUBESTORE_AWS_ACCESS_KEY_ID: ${{ secrets.CUBESTORE_AWS_ACCESS_KEY_ID }}
Expand All @@ -58,8 +56,8 @@ jobs:
TEST_KSQL_USER: ${{ secrets.TEST_KSQL_USER }}
TEST_KSQL_PASS: ${{ secrets.TEST_KSQL_PASS }}
TEST_KSQL_URL: ${{ secrets.TEST_KSQL_URL }}
run: |
cargo test --manifest-path rust/cubestore/Cargo.toml -j 1
run: cargo test -- --test-threads=1
working-directory: rust/cubestore

cubestore-docker-image-dev:
name: Release Cube Store :dev image
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/rust-cubestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,21 @@ jobs:
# We should use a separate key for testing to pass disk space limitations
shared-key: cubestore-testing
key: ubuntu-22.04
- name: Run cargo fmt cubestore
run: |
cargo fmt --manifest-path rust/cubestore/cubestore/Cargo.toml -- --check
- name: Run cargo fmt cubehll
run: |
cargo fmt --manifest-path rust/cubestore/cubehll/Cargo.toml -- --check
- name: Run cargo build
run: |
cargo build --manifest-path rust/cubestore/Cargo.toml
- name: Run cargo fmt
run: cargo fmt --check
working-directory: rust/cubestore
- name: Run cargo check
# Re-using test profile to speedup builds
run: cargo check --benches --profile test
working-directory: rust/cubestore
- name: Run cargo test
env:
# LocalDirRemoteFs expect that std::env::temp_dir and its local dir is on same FS, to use `rename`
# On Unix it's controlled by TMPDIR
# When using `container` in GHA checkout will be located in `/__w`, and that's a separate mount from `/tmp`
TMPDIR: /__w/tmp
run: |
cargo test --manifest-path rust/cubestore/Cargo.toml
run: cargo test -- --test-threads=1
working-directory: rust/cubestore

docker-image-latest:
name: Build only :latest image
Expand Down
47 changes: 41 additions & 6 deletions rust/cubestore/cubestore-sql-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use async_trait::async_trait;
use cubestore::sql::{QueryPlans, SqlQueryContext, SqlService};
use cubestore::store::DataFrame;
use cubestore::CubeError;
use std::env;
use std::env::args;
use std::panic::RefUnwindSafe;
use std::sync::Arc;
use test::TestFn::DynTestFn;
Expand Down Expand Up @@ -65,11 +65,19 @@ pub fn run_sql_tests(
})
.collect();

test::test_main(
&env::args().chain(extra_args).collect::<Vec<String>>(),
tests,
None,
);
test::test_main(&merge_args(args().collect(), extra_args), tests, None);
}

fn merge_args(mut base: Vec<String>, extra: Vec<String>) -> Vec<String> {
for extra_arg in extra.into_iter() {
if let Some((arg_name, _arg_value)) = extra_arg.split_once('=') {
base.retain(|a| !a.starts_with(arg_name));
}

base.push(extra_arg.to_string());
}

base
}

#[async_trait]
Expand All @@ -90,3 +98,30 @@ impl SqlClient for Arc<dyn SqlService> {
self.as_ref().plan_query(query).await
}
}

#[cfg(test)]
mod test_helpers {
use super::*;

#[test]
fn test_merge_args() {
let base = vec![
"path/to/executable".to_string(),
"--test-threads=1".to_string(),
];
let extra = vec![
"--test-threads=2".to_string(),
"--skip=planning_inplace_aggregate2".to_string(),
];

let merged = merge_args(base, extra);
assert_eq!(
merged,
vec![
"path/to/executable",
"--test-threads=2",
"--skip=planning_inplace_aggregate2"
]
);
}
}
2 changes: 1 addition & 1 deletion rust/cubestore/cubestore/benches/cachestore_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fn do_benches(c: &mut Criterion) {
do_list_bench(c, &runtime, Some(QueueItemStatus::Pending), 1_000, 128, 128);
do_list_bench(c, &runtime, Some(QueueItemStatus::Active), 1_000, 128, 128);

do_get_bench(c, &runtime, 2_500, 128, 128, 4na);
do_get_bench(c, &runtime, 2_500, 128, 128, 4);
}

criterion_group!(benches, do_benches);
Expand Down
Loading