Skip to content

Use the official OllamaContainer in the Ollama starter ITs, and assert model pulls succeed - #212

Open
Lubaoshuai wants to merge 1 commit into
langchain4j:mainfrom
Lubaoshuai:test/ollama-starter-ollama-container
Open

Lubaoshuai wants to merge 1 commit into
langchain4j:mainfrom
Lubaoshuai:test/ollama-starter-ollama-container

Conversation

@Lubaoshuai

Copy link
Copy Markdown

Issue

Closes langchain4j/langchain4j#2101

Change

Improves AutoConfigIT of the Ollama Spring Boot starter, as requested in the issue:

  • Replaces the manually configured GenericContainer with the official org.testcontainers:ollama module (OllamaContainer), which declares the Ollama port itself and provides getEndpoint().
  • Asserts the exit code of ollama pull for both models (phi, all-minilm), so a missing or renamed model now fails fast with a clear message instead of surfacing as confusing downstream test failures.
  • Adds org.testcontainers:ollama as a test dependency (version managed by the Spring Boot BOM).
  • The OLLAMA_BASE_URL escape hatch for pointing the ITs at an external Ollama instance is preserved.

Note: the Ollama ITs are excluded from the PR build via -DskipOllamaITs and run in the nightly workflow; Docker is not available in my local environment, so they were verified by compile + review and will be exercised by the nightly run.

General checklist

  • There are no breaking changes
  • I have added unit and/or integration tests for my change
  • The tests cover both positive and negative cases
  • I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
  • I have added/updated the documentation
  • I have added an example in the examples repo (only for "big" features)

@Lubaoshuai

Copy link
Copy Markdown
Author

Friendly ping — the "Java CI" workflow is sitting in action_required, so it needs a maintainer to click "Approve and run workflows" for this first-time-contributor run. Everything else is ready on my side (no conflicts with the base branch). Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama: improve Spring Boot starter tests

1 participant