diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2920b4f8..8a3c000c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: [pull_request, workflow_dispatch] permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-and-test-extension: services: diff --git a/projects/extension/tests/contents/output16.expected b/projects/extension/tests/contents/output16.expected index 327266c6..52e25b1b 100644 --- a/projects/extension/tests/contents/output16.expected +++ b/projects/extension/tests/contents/output16.expected @@ -97,7 +97,7 @@ CREATE EXTENSION table ai.vectorizer_errors view ai.secret_permissions view ai.vectorizer_status -(92 rows) +(93 rows) Table "ai._secret_permissions" Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description diff --git a/projects/pgai/tests/vectorizer/test_vectorizer_cli.py b/projects/pgai/tests/vectorizer/test_vectorizer_cli.py index b85cb8b1..7547fb7f 100644 --- a/projects/pgai/tests/vectorizer/test_vectorizer_cli.py +++ b/projects/pgai/tests/vectorizer/test_vectorizer_cli.py @@ -1014,14 +1014,15 @@ def test_vectorization_successful_with_null_contents( @pytest.mark.parametrize( "embedding", [ - ("openai/text-embedding-3-small", 1536, {}), - ("voyage/voyage-3-lite", 512, {}), - ("mistral/mistral-embed", 1024, {}), - ("cohere/embed-english-v3.0", 1024, {}), + ("openai/text-embedding-3-small", 1536, {}, "OPENAI_API_KEY"), + ("voyage/voyage-3-lite", 512, {}, "VOYAGE_API_KEY"), + ("mistral/mistral-embed", 1024, {}, "MISTRAL_API_KEY"), + ("cohere/embed-english-v3.0", 1024, {}, "COHERE_API_KEY"), ( "huggingface/microsoft/codebert-base", 768, {"wait_for_model": True, "use_cache": False}, + "HUGGINGFACE_API_KEY", ), ], ) @@ -1029,13 +1030,16 @@ def test_litellm_vectorizer( source_table: str, cli_db: tuple[TestDatabase, Connection], cli_db_url: str, - embedding: tuple[str, int, dict[str, Any]], + embedding: tuple[str, int, dict[str, Any], str], vcr_: Any, test_params: tuple[int, int, int, str, str], ): - model, dimensions, extra_options = embedding + model, dimensions, extra_options, api_key_name = embedding function = "embedding_litellm" + if api_key_name not in os.environ: + pytest.skip(f"environment variable '{api_key_name}' unset") + embedding_str = f"{function}('{model}', {dimensions}, extra_options => '{json.dumps(extra_options)}'::jsonb)" # noqa: E501 Line too long vectorizer_id = configure_vectorizer(