test: keep production GIS available without AI scope evidence
This commit is contained in:
@@ -26,28 +26,21 @@ def test_production_yolo_rejects_disabled_validation_scope() -> None:
|
|||||||
app_env="production",
|
app_env="production",
|
||||||
yolo_enabled=True,
|
yolo_enabled=True,
|
||||||
yolo_enforce_validation_scope=False,
|
yolo_enforce_validation_scope=False,
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_production_yolo_requires_validation_scope_manifest() -> None:
|
|
||||||
with pytest.raises(ValidationError, match="YOLO_VALIDATION_SCOPE_MANIFEST_PATH"):
|
|
||||||
_settings(
|
|
||||||
app_env="production",
|
|
||||||
yolo_enabled=True,
|
|
||||||
yolo_require_cuda=True,
|
yolo_require_cuda=True,
|
||||||
yolo_device="cuda:0",
|
yolo_device="cuda:0",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_production_yolo_requires_validation_scope_hash() -> None:
|
def test_production_yolo_can_start_without_scope_evidence() -> None:
|
||||||
with pytest.raises(ValidationError, match="YOLO_VALIDATION_SCOPE_MANIFEST_SHA256"):
|
settings = _settings(
|
||||||
_settings(
|
app_env="production",
|
||||||
app_env="production",
|
yolo_enabled=True,
|
||||||
yolo_enabled=True,
|
yolo_require_cuda=True,
|
||||||
yolo_validation_scope_manifest_path="/app/storage/model-scope.json",
|
yolo_device="cuda:0",
|
||||||
yolo_require_cuda=True,
|
)
|
||||||
yolo_device="cuda:0",
|
assert settings.yolo_enforce_validation_scope is True
|
||||||
)
|
assert settings.yolo_validation_scope_manifest_path is None
|
||||||
|
assert settings.yolo_validation_scope_manifest_sha256 is None
|
||||||
|
|
||||||
|
|
||||||
def test_production_yolo_requires_cuda() -> None:
|
def test_production_yolo_requires_cuda() -> None:
|
||||||
@@ -55,8 +48,6 @@ def test_production_yolo_requires_cuda() -> None:
|
|||||||
_settings(
|
_settings(
|
||||||
app_env="production",
|
app_env="production",
|
||||||
yolo_enabled=True,
|
yolo_enabled=True,
|
||||||
yolo_validation_scope_manifest_path="/app/storage/model-scope.json",
|
|
||||||
yolo_validation_scope_manifest_sha256="a" * 64,
|
|
||||||
yolo_require_cuda=False,
|
yolo_require_cuda=False,
|
||||||
yolo_device="cuda:0",
|
yolo_device="cuda:0",
|
||||||
)
|
)
|
||||||
@@ -67,8 +58,6 @@ def test_production_yolo_requires_cuda_device() -> None:
|
|||||||
_settings(
|
_settings(
|
||||||
app_env="production",
|
app_env="production",
|
||||||
yolo_enabled=True,
|
yolo_enabled=True,
|
||||||
yolo_validation_scope_manifest_path="/app/storage/model-scope.json",
|
|
||||||
yolo_validation_scope_manifest_sha256="a" * 64,
|
|
||||||
yolo_require_cuda=True,
|
yolo_require_cuda=True,
|
||||||
yolo_device="cpu",
|
yolo_device="cpu",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user