Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tests/test_gitlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ def test_installed_ocr_projected_review_matches_native_manifest(
) -> None:
"""Opt-in production proof against the official binary and local fake provider."""

binary, _version = qualified_native_ocr("OCR_GITLINK_QUALIFY_BINARY")
binary, version = qualified_native_ocr("OCR_GITLINK_QUALIFY_BINARY")
monkeypatch.syspath_prepend(str(Path(__file__).resolve().parents[1] / "scripts"))
from ocr_qualification.peer import _stub_gateway

Expand Down Expand Up @@ -1397,12 +1397,24 @@ def test_installed_ocr_projected_review_matches_native_manifest(
timeout=30,
)
assert preview.returncode == 0 and preview.stderr == b""
if kind == "ordinary" and version == "1.14.5":
# This qualified binary omits tracked gitignored files from preview.
assert {entry.path for entry in projection.ordinary_diff} == {"hidden.py", "selected.py"}
assert [item["path"] for item in json.loads(preview.stdout)["files"]] == ["selected.py"]
with pytest.raises(RepositoryEvidenceError, match="omitted or added diff records"):
qualify_review_preview(projection, preview.stdout)
return
selection = qualify_review_preview(projection, preview.stdout)
selected = selection.selected
assert selected
assert all(entry.status != "D" for entry in selected)
if kind in {"added", "updated", "deleted"}:
assert selected == projection.ordinary_diff
elif kind == "ordinary":
assert [entry.path for entry in selected] == ["selected.py"]
assert [(item.entry.path, item.reason) for item in selection.excluded] == [
("hidden.py", "gitignore")
]
elif kind == "ordinary-non-utf8":
assert [entry.path for entry in selected] == ["selected.py"]
assert [(item.entry.path, item.reason) for item in selection.excluded] == [
Expand Down
Loading