perf(ops): streamline log capture and git error reporting
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
committed by
Hermes Agent
co-authored by
genichin
parent
619feff5f4
commit
8378e03dcc
@@ -12,6 +12,8 @@ import uuid
|
||||
from datetime import UTC, date, datetime
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from trex_core.adapters.persistence.ops_checks import (
|
||||
collect_release_provenance,
|
||||
find_ledger_gap_slots,
|
||||
@@ -179,3 +181,18 @@ def test_collect_release_provenance_rejects_runtime_path_escape(tmp_path):
|
||||
assert runtime["path_within_checkout"] is False
|
||||
assert runtime["matches_expected_revision"] is False
|
||||
assert report["gate"]["passed"] is False
|
||||
|
||||
|
||||
def test_collect_release_provenance_reports_git_failure_context(tmp_path):
|
||||
not_repo = tmp_path / "not-repo"
|
||||
not_repo.mkdir()
|
||||
with pytest.raises(RuntimeError, match="git command failed in checkout="):
|
||||
collect_release_provenance(
|
||||
actor="operator-a",
|
||||
reason="deploy",
|
||||
instance="inst-a",
|
||||
command_class="manual-start",
|
||||
checkout_dir=not_repo,
|
||||
capture_commands={},
|
||||
broker_log_path=None,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user