Skip to content

Commit

Permalink
Fixes for nextest
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Sep 19, 2024
1 parent 50c090d commit 451b0a6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/_rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Test
# --all-targets tests benchmarks
run: cargo nextest run --all-targets
run: cargo nextest run
test-integration:
strategy:
matrix:
Expand All @@ -37,3 +36,24 @@ jobs:
uses: ./.github/actions/tilt
- name: Run tests
run: cargo nextest run --profile k8s_integration
test-benches:
strategy:
matrix:
platform: [depot-ubuntu-22.04-16]
runs-on: ${{ matrix.platform }}
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/rust
- name: Cache test datasets
uses: actions/cache@v4
with:
path: /home/runner/.cache/chroma-test-datasets
key: chroma-test-datasets
- name: Build
run: cargo build --verbose
- name: Test benches
run: cargo nextest run --benches
1 change: 0 additions & 1 deletion rust/benchmark-datasets/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ where
Fut: Future<Output = Result<()>>,
{
let dataset_dir = get_dataset_cache_path(dataset_name, cache_dir).await?;
println!("dataset_dir: {:?}", dataset_dir);
let file_path = dataset_dir.join(file_name);

if !file_path.exists() {
Expand Down
4 changes: 2 additions & 2 deletions rust/worker/benches/fulltext_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ fn bench_querying(c: &mut Criterion) {
let mut querying_group = c.benchmark_group("querying");
querying_group.throughput(Throughput::Elements(1));

let mut query_iter = query_subset.queries.iter().cycle();

let segment_reader = runner.block_on(async {
let metadata_segment = compact_log_to_storage(&blockfile_provider, log_chunk.clone())
.await
Expand All @@ -147,8 +149,6 @@ fn bench_querying(c: &mut Criterion) {
)
});

let mut query_iter = query_subset.queries.iter().cycle();

querying_group.bench_function(format!("scidocs ({} records)", log_chunk.len()), |b| {
b.to_async(&runner).iter_batched(
|| (segment_reader.clone(), query_iter.next().unwrap().clone()),
Expand Down

0 comments on commit 451b0a6

Please sign in to comment.