Initial public release
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT = Path(__file__).parents[2] / "scripts" / "supervise_container_yolo_training.py"
|
||||
SPEC = importlib.util.spec_from_file_location("yolo_supervisor", SCRIPT)
|
||||
assert SPEC and SPEC.loader
|
||||
MODULE = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
def test_training_active_requires_yolo_train_and_exact_marker(monkeypatch) -> None:
|
||||
class Result:
|
||||
returncode = 0
|
||||
stdout = "python api.py\npython3 /opt/venv/bin/yolo train resume=/runs/v37/weights/last.pt device=0\n"
|
||||
|
||||
monkeypatch.setattr(MODULE.subprocess, "run", lambda *args, **kwargs: Result())
|
||||
assert MODULE.training_active("geointel", "/runs/v37") is True
|
||||
assert MODULE.training_active("geointel", "/runs/v38") is False
|
||||
|
||||
|
||||
def test_container_running_fails_closed_on_inspect_error(monkeypatch) -> None:
|
||||
class Result:
|
||||
returncode = 1
|
||||
stdout = ""
|
||||
|
||||
monkeypatch.setattr(MODULE.subprocess, "run", lambda *args, **kwargs: Result())
|
||||
assert MODULE.container_running("missing") is False
|
||||
|
||||
|
||||
def test_completion_command_requires_non_empty_string_list(tmp_path: Path) -> None:
|
||||
invalid = tmp_path / "command.json"
|
||||
invalid.write_text('{"shell": "unsafe"}', encoding="utf-8")
|
||||
try:
|
||||
MODULE.load_completion_command(invalid)
|
||||
except ValueError as exc:
|
||||
assert "non-empty JSON list" in str(exc)
|
||||
else:
|
||||
raise AssertionError("mapping-shaped completion command was accepted")
|
||||
|
||||
|
||||
def test_completion_command_preserves_exact_argv_without_shell_parsing(tmp_path: Path) -> None:
|
||||
command = tmp_path / "command.json"
|
||||
command.write_text('["docker", "exec", "-d", "geointel", "python", "loop.py"]', encoding="utf-8")
|
||||
assert MODULE.load_completion_command(command) == [
|
||||
"docker", "exec", "-d", "geointel", "python", "loop.py"
|
||||
]
|
||||
Reference in New Issue
Block a user