Files
geointel/backend/tests/test_sprint159_split_promotion_workflow.py
T
Codex 3d4bcb1c6e
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled
Add split promotion preflight
2026-07-10 13:49:00 +02:00

42 lines
1.7 KiB
Python

from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def test_split_background_promotion_workflow_runs_split_then_split_aware_report() -> None:
script_path = ROOT / "scripts" / "run_split_background_promotion_workflow.sh"
assert script_path.exists()
source = script_path.read_text(encoding="utf-8")
assert "run_background_corpus_split_matrix.sh" in source
assert "build_detection_model_promotion_report.py" in source
assert "--background-split-summary" in source
assert "background_corpus_split_summary.json" in source
assert "PROMOTION_POSITIVE_PORTFOLIO_PATH" in source
assert "BACKGROUND_SPLIT_OUTPUT_DIR" in source
assert "PROMOTION_OUTPUT_DIR" in source
assert "--hard-negative-summary" not in source
assert "download model" not in source.lower()
assert "promote model default" not in source.lower()
def test_split_background_promotion_workflow_has_safe_preflight_mode() -> None:
source = (ROOT / "scripts" / "run_split_background_promotion_workflow.sh").read_text(encoding="utf-8")
assert "--preflight-only" in source
assert "PREFLIGHT_ONLY" in source
assert "curl -fsS" in source
assert "OPERATOR_SAMPLE_MANIFEST_PATH is required" in source
assert "pure_empty_negative" in source
assert "sparse_building_context" in source
assert "Split-background promotion preflight passed" in source
def test_readiness_checks_split_background_promotion_workflow_syntax() -> None:
readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8")
assert "bash -n scripts/run_split_background_promotion_workflow.sh" in readiness