Protect manifest artifacts in RC10 audit
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 07:15:40 +02:00
parent 6438bd418b
commit bb38d8a6a3
3 changed files with 75 additions and 5 deletions
@@ -146,6 +146,43 @@ def test_storage_audit_only_selects_old_unreferenced_allowlisted_files(
assert "release-evidence" in report["cleanup"]["protected_prefixes"]
def test_referenced_tile_manifest_protects_its_tiles(tmp_path: Path) -> None:
audit = load_script("audit_data_operations.py")
storage = tmp_path / "storage"
manifest = storage / "tiles" / "dataset" / "set" / "manifest.json"
tile = manifest.parent / "tile_0000.tif"
tile.parent.mkdir(parents=True)
tile.write_bytes(b"tile")
manifest.write_text(json.dumps({"tiles": [{"path": "tile_0000.tif"}]}), encoding="utf-8")
expanded = audit.expand_manifest_references({manifest.resolve()}, storage)
assert manifest.resolve() in expanded
assert tile.resolve() in expanded
def test_disk_pressure_uses_absolute_headroom_for_large_arrays(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
audit = load_script("audit_data_operations.py")
monkeypatch.setattr(
audit.shutil,
"disk_usage",
lambda _path: SimpleNamespace(
total=56 * 1024**4,
used=(56 * 1024**4) - (700 * 1024**3),
free=700 * 1024**3,
),
)
pressure = audit.disk_pressure(tmp_path)
assert pressure["free_percent"] < 2
assert pressure["status"] == "ok"
assert pressure["acquisition_allowed"] is True
def test_source_family_report_covers_national_regional_and_maritime(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,