Optional Ollama integration testing (GPU self-hosted runner)
Mock-based pytest remains the required CI gate on every merge request. This document describes an optional live integration lane for a self-hosted runner with Ollama already running (for example a desktop with a GPU).
Why add this lane
| Layer | Runs on | Validates |
|---|---|---|
test:pytest (mocks) | Any runner | Provider wiring, errors, JSON parsing, M4 pipeline |
test:integration:ollama (optional) | Tagged GPU runner | Real Ollama /v1, prompt, model output, latency |
Use the optional job when you want confidence that --provider ollama works against a live
model — not as a substitute for mock tests.
Prerequisites (runner host)
- GitLab runner registered with tag
gpu-ollama(shell executor on your desktop is fine). - Ollama running (
ollama serveor OS service). - Model pulled, e.g.
ollama pull llama3.2. - Python 3.11+ and editable install:
pip install -e "./packages/a2c-core" -e "./packages/a2c-cli" -e "./packages/a2c-tui" -e ".[dev]"(or let the CI job do it). a2con PATH after install.
Default Ollama address: http://127.0.0.1:11434 (override with OLLAMA_HOST).
Local smoke (no CI)
# Unix
./scripts/smoke-ollama-decompose.sh
# Windows
.\scripts\smoke-ollama-decompose.ps1
Optional:
OLLAMA_MODEL=mistral ./scripts/smoke-ollama-decompose.sh
The script copies tests/fixtures/repos/decompose_source/, runs
a2c plan decompose-epic epic-onboarding --provider ollama, and checks for a proposal
summary plus at least one task- id. It does not run apply (no writes to a real repo).
GitLab CI job
Job name: test:integration:ollama in .gitlab-ci.yml.
| Property | Value |
|---|---|
tags | gpu-ollama |
allow_failure | true (optional lane; does not block merge by default) |
| Triggers | Pipeline schedule, manual Run pipeline, or RUN_OLLAMA_INTEGRATION=true |
The job does not use a Docker image: — it runs on the runner host where Ollama lives.
Enable on a pipeline manually
GitLab → Run pipeline → add variable:
RUN_OLLAMA_INTEGRATION = true
Register the runner (summary)
- Install GitLab Runner on the desktop.
- Register with your project/group and set tag
gpu-ollama. - Use shell executor (or equivalent that can reach local Ollama).
- Ensure the runner user can run
pip install -e .anda2c.
What we assert (and what we avoid)
Assert (soft):
- Ollama reachable (
/api/tags) a2c plan decompose-epicexits 0- Output mentions proposed tasks and a
task-id
Do not assert:
- Exact task titles or count (models are non-deterministic)
- Golden JSON snapshots of LLM output
Operational notes
- Concurrency: run one Ollama integration job at a time if GPU memory is tight (
resource_groupin GitLab). - Availability: pipeline succeeds on shared runners even when the desktop is off; this job stays skipped or
allow_failure. - Pin the model via
OLLAMA_MODEL(defaultllama3.2) for comparable runs over time.
Related
- epic-decomposition.md — provider configuration
- cli.md — CLI reference
- pathname:///a2c-assets/plans/milestone-ollama-native-sdk.md — future native SDK extra