Skip to content

Commit 7158e64

Browse files
committed
refactor: remove require_ollama() predicate — redundant with backend marker
The ollama backend marker + conftest auto-skip already handles Ollama availability. No other backend has a dedicated predicate — consistent to let the marker system handle it.
1 parent b509b46 commit 7158e64

3 files changed

Lines changed: 4 additions & 29 deletions

File tree

.agents/skills/audit-markers/SKILL.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,13 @@ the explicit size.
415415
|---------|--------------------|--------------------|
416416
| `LocalHFBackend` | Yes | `require_gpu(min_vram_gb=N)` |
417417
| `LocalVLLMBackend` | Yes | `require_gpu(min_vram_gb=N)` |
418-
| `OllamaModelBackend` | Managed by Ollama | `require_ollama()` only |
418+
| `OllamaModelBackend` | Managed by Ollama | None — `ollama` backend marker + conftest auto-skip handles availability |
419419
| `OpenAIBackend` (real API) | No | No GPU gate |
420-
| `OpenAIBackend` → Ollama `/v1` | Managed by Ollama | `require_ollama()` only |
420+
| `OpenAIBackend` → Ollama `/v1` | Managed by Ollama | None — `ollama` backend marker handles it |
421421
| `WatsonxAIBackend` / `LiteLLMBackend` / Cloud | No | No GPU gate |
422422

423423
**Key rule:** Ollama manages its own GPU memory. Tests using Ollama backends
424-
should use `require_ollama()`, NOT `require_gpu()`.
424+
should use the `ollama` backend marker only, NOT `require_gpu()`.
425425

426426
#### Compute VRAM estimate
427427

@@ -497,7 +497,6 @@ Read `test/predicates.py` for the available predicates. Expected patterns:
497497
| `require_api_key("OPENAI_API_KEY")` | Specific API credentials |
498498
| `require_api_key("WATSONX_API_KEY", "WATSONX_URL", "WATSONX_PROJECT_ID")` | Multiple credentials |
499499
| `require_package("cpex.framework")` | Optional dependency |
500-
| `require_ollama()` | Running Ollama server |
501500
| `require_python((3, 11))` | Minimum Python version |
502501

503502
Typical combinations for backends:
@@ -725,4 +724,4 @@ flag as a blocker, don't silently re-add:
725724
`pyproject.toml` and `test/MARKERS_GUIDE.md` must stay in sync manually.
726725
- **Resource predicates:** `test/predicates.py` provides `require_gpu`,
727726
`require_ram`, `require_api_key`, `require_package`,
728-
`require_ollama`, `require_python`.
727+
`require_python`.

test/MARKERS_GUIDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ from test.predicates import require_gpu, require_api_key
155155
| `require_ram(min_gb=N)` | N GB+ system RAM (genuinely RAM-bound tests only) |
156156
| `require_api_key("ENV_VAR")` | Specific API credentials |
157157
| `require_package("pkg")` | Optional dependency |
158-
| `require_ollama()` | Running Ollama server |
159158
| `require_python((3, 11))` | Minimum Python version |
160159

161160
### Typical combinations

test/predicates.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,6 @@ def test_plugin_registration(): ...
179179
return pytest.mark.skipif(not available, reason=f"{package} not installed")
180180

181181

182-
# ---------------------------------------------------------------------------
183-
# Service reachability
184-
# ---------------------------------------------------------------------------
185-
186-
187-
def require_ollama(*, host: str = "localhost", port: int = 11434):
188-
"""Skip unless Ollama is reachable on the given host/port."""
189-
import socket
190-
191-
try:
192-
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
193-
sock.settimeout(1)
194-
result = sock.connect_ex((host, port))
195-
sock.close()
196-
reachable = result == 0
197-
except Exception:
198-
reachable = False
199-
200-
return pytest.mark.skipif(
201-
not reachable, reason=f"Ollama not available at {host}:{port}"
202-
)
203-
204-
205182
# ---------------------------------------------------------------------------
206183
# Python version
207184
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)