diff --git a/contrib/spring-ai/README.md b/contrib/spring-ai/README.md index 89ef579f0..a6b672a91 100644 --- a/contrib/spring-ai/README.md +++ b/contrib/spring-ai/README.md @@ -668,16 +668,19 @@ The library includes comprehensive integration tests for different providers: ### Running Integration Tests ```bash -# Opt in to integration tests (gates the Gemini and Ollama tests) +# Opt in to GeminiApiIntegrationTest export ADK_RUN_INTEGRATION_TESTS=true # Set Gemini model name for integration tests -export GEMINi_MODEL=gemini-3.8-flash +export GEMINI_MODEL=gemini-3.8-flash # Set required environment variables export OPENAI_API_KEY=your_key export GOOGLE_CLOUD_PROJECT=your_project_id export ANTHROPIC_API_KEY=your_key +# Opt in to LocalModelIntegrationTest, which runs Ollama in Docker +export ADK_RUN_LOCAL_MODEL_TESTS=true + # Run specific integration test mvn test -Dtest=OpenAiApiIntegrationTest diff --git a/contrib/spring-ai/src/test/java/com/google/adk/models/springai/ollama/LocalModelIntegrationTest.java b/contrib/spring-ai/src/test/java/com/google/adk/models/springai/ollama/LocalModelIntegrationTest.java index 1c8e020be..d3bd79db4 100644 --- a/contrib/spring-ai/src/test/java/com/google/adk/models/springai/ollama/LocalModelIntegrationTest.java +++ b/contrib/spring-ai/src/test/java/com/google/adk/models/springai/ollama/LocalModelIntegrationTest.java @@ -34,8 +34,8 @@ import org.springframework.ai.ollama.api.OllamaApi; import org.springframework.ai.ollama.api.OllamaChatOptions; -// @Disabled("To avoid making the assumption that Ollama is available in the CI pipeline") -@EnabledIfEnvironmentVariable(named = "ADK_RUN_INTEGRATION_TESTS", matches = "true") +/** Needs Docker for Ollama; runs only when {@code ADK_RUN_LOCAL_MODEL_TESTS=true}. */ +@EnabledIfEnvironmentVariable(named = "ADK_RUN_LOCAL_MODEL_TESTS", matches = "true") class LocalModelIntegrationTest { private static OllamaTestContainer ollamaContainer;