From ca1ad5156440b8f57531a185d95552c53b0f8e38 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 6 Feb 2025 17:05:26 +0100 Subject: [PATCH] Put the Ollama tests under a feature --- .github/workflows/test-suite.yml | 6 +++--- crates/meilisearch/Cargo.toml | 1 + crates/meilisearch/tests/vector/mod.rs | 1 + crates/xtask/src/main.rs | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index d615c1392..59436e0bc 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -84,10 +84,10 @@ jobs: - uses: dtolnay/rust-toolchain@1.81 - name: Run cargo build with almost all features run: | - cargo build --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda)" + cargo build --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda,test-ollama)" - name: Run cargo test with almost all features run: | - cargo test --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda)" + cargo test --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda,test-ollama)" ollama-ubuntu: name: Test with Ollama @@ -119,7 +119,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --locked --release --all ollama + args: --locked --release --all --features test-ollama ollama test-disabled-tokenization: name: Test disabled tokenization diff --git a/crates/meilisearch/Cargo.toml b/crates/meilisearch/Cargo.toml index 1baff114f..60af4dcba 100644 --- a/crates/meilisearch/Cargo.toml +++ b/crates/meilisearch/Cargo.toml @@ -145,6 +145,7 @@ zip = { version = "2.2.2", optional = true } [features] default = ["meilisearch-types/all-tokenizations", "mini-dashboard"] swagger = ["utoipa-scalar"] +test-ollama = [] mini-dashboard = [ "static-files", "anyhow", diff --git a/crates/meilisearch/tests/vector/mod.rs b/crates/meilisearch/tests/vector/mod.rs index 8db3c766c..67da51702 100644 --- a/crates/meilisearch/tests/vector/mod.rs +++ b/crates/meilisearch/tests/vector/mod.rs @@ -1,4 +1,5 @@ mod binary_quantized; +#[cfg(feature = "test-ollama")] mod ollama; mod openai; mod rest; diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index 942362f4f..f260bd404 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -6,8 +6,8 @@ use xtask::bench::BenchDeriveArgs; /// List features available in the workspace #[derive(Parser, Debug)] struct ListFeaturesDeriveArgs { - /// Feature to exclude from the list. Repeat the argument to exclude multiple features - #[arg(short, long)] + /// Feature to exclude from the list. Use a comma to separate multiple features. + #[arg(short, long, value_delimiter = ',')] exclude_feature: Vec, }