From b1d0072c13aefd6c32a25f893ce0a559871ee3d3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 17:07:33 +0000 Subject: [PATCH] Fix failing tests: update expectations for new URL-as-is behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update test inputs to provide complete URLs with /api/embeddings endpoint - Remove tests for automatic URL construction that no longer exists - Tests now reflect the requirement for users to provide complete URLs - Addresses CI failures after removing _construct_embeddings_url helper Co-Authored-By: João --- tests/utilities/test_ollama_embedding_configurator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/utilities/test_ollama_embedding_configurator.py b/tests/utilities/test_ollama_embedding_configurator.py index 7f8cd6be6..62f81f06c 100644 --- a/tests/utilities/test_ollama_embedding_configurator.py +++ b/tests/utilities/test_ollama_embedding_configurator.py @@ -31,7 +31,7 @@ class TestOllamaEmbeddingConfigurator: model_name="llama2" ) - @patch.dict(os.environ, {"API_BASE": "http://env-ollama:8080"}, clear=True) + @patch.dict(os.environ, {"API_BASE": "http://env-ollama:8080/api/embeddings"}, clear=True) def test_ollama_config_url_overrides_env_var(self): config = { "provider": "ollama", @@ -84,7 +84,7 @@ class TestOllamaEmbeddingConfigurator: ) @patch.dict(os.environ, {"API_BASE": "http://localhost:11434/api/embeddings"}, clear=True) - def test_ollama_handles_full_url_in_api_base(self): + def test_ollama_uses_provided_url_as_is(self): config = {"provider": "ollama", "config": {"model": "llama2"}} with patch("chromadb.utils.embedding_functions.ollama_embedding_function.OllamaEmbeddingFunction") as mock_ollama: @@ -94,14 +94,15 @@ class TestOllamaEmbeddingConfigurator: model_name="llama2" ) - @patch.dict(os.environ, {"API_BASE": "http://localhost:11434/api/embeddings"}, clear=True) - def test_ollama_uses_provided_url_as_is(self): + @patch.dict(os.environ, {"API_BASE": "http://custom-base:9000"}, clear=True) + def test_ollama_requires_complete_url_in_api_base(self): + """Test that demonstrates users must provide complete URLs including endpoint.""" config = {"provider": "ollama", "config": {"model": "llama2"}} with patch("chromadb.utils.embedding_functions.ollama_embedding_function.OllamaEmbeddingFunction") as mock_ollama: self.configurator.configure_embedder(config) mock_ollama.assert_called_once_with( - url="http://localhost:11434/api/embeddings", + url="http://custom-base:9000", model_name="llama2" )