|
13 | 13 | sys.path.insert(0, str(REPO_ROOT)) |
14 | 14 |
|
15 | 15 | import scripts.export as export |
| 16 | +from models.error_codes import ErrorCode |
16 | 17 | from tests.test_cli_e2e import _run_cli, _seed_base_dir |
17 | | -from utils.export_engine import BulkExportResult |
| 18 | +from utils.export_engine import BulkExportResult, ExportFailure |
18 | 19 | from utils.jsonl_parser import parse_session |
19 | 20 |
|
20 | 21 | _SUMMARY_RE = re.compile( |
@@ -133,8 +134,17 @@ def _track_exit(result: BulkExportResult) -> None: |
133 | 134 |
|
134 | 135 |
|
135 | 136 | def test_since_last_early_return_exits_one_on_failure(tmp_path, monkeypatch, capsys): |
136 | | - """Since-last early-return with failure_count>0 must produce real exit code 1.""" |
137 | | - fake_result = BulkExportResult(latest_day=None, failure_count=1) |
| 137 | + """Since-last early-return with failures must produce real exit code 1.""" |
| 138 | + fake_result = BulkExportResult( |
| 139 | + latest_day=None, |
| 140 | + failures=[ |
| 141 | + ExportFailure( |
| 142 | + session_id="session_fail", |
| 143 | + message="Failed to parse session", |
| 144 | + code=ErrorCode.PARSE_ERROR, |
| 145 | + ) |
| 146 | + ], |
| 147 | + ) |
138 | 148 |
|
139 | 149 | monkeypatch.setattr(export, "run_bulk_export", lambda **kwargs: fake_result) |
140 | 150 | monkeypatch.setattr(export, "list_projects", lambda base: [{"name": "p", "path": "/p"}]) |
|
0 commit comments