Skip to content

Commit 1a6310f

Browse files
charlesblucaclaude
andcommitted
fix(harness): update tests for _run_entry full result passthrough
Two tests were asserting on keys from the old compact wrapper dict (artifact_dir, tags at top level). Update them to match the new behavior: capture artifact_dir via the fake's closure, and have the fake return tags as real _run_single does. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 601f442 commit 1a6310f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nemo_retriever/tests/test_harness_run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ def test_run_entry_session_artifact_dir_uses_run_name(monkeypatch, tmp_path: Pat
322322
)
323323
monkeypatch.setattr(harness_run, "load_harness_config", lambda **_: cfg)
324324

325+
captured_artifact_dir: list[Path] = []
326+
325327
def _fake_run_single(_cfg: HarnessConfig, _artifact_dir: Path, run_id: str, tags: list[str] | None = None) -> dict:
328+
captured_artifact_dir.append(_artifact_dir)
326329
assert tags == []
327330
return {
328331
"success": True,
@@ -333,15 +336,15 @@ def _fake_run_single(_cfg: HarnessConfig, _artifact_dir: Path, run_id: str, tags
333336

334337
monkeypatch.setattr(harness_run, "_run_single", _fake_run_single)
335338

336-
result = harness_run._run_entry(
339+
harness_run._run_entry(
337340
run_name="jp20_single",
338341
config_file=None,
339342
session_dir=tmp_path,
340343
dataset="jp20",
341344
preset="single_gpu",
342345
)
343346

344-
assert Path(result["artifact_dir"]).name == "jp20_single"
347+
assert captured_artifact_dir[0].name == "jp20_single"
345348

346349

347350
def test_run_entry_returns_tags(monkeypatch, tmp_path: Path) -> None:
@@ -363,6 +366,7 @@ def _fake_run_single(_cfg: HarnessConfig, _artifact_dir: Path, run_id: str, tags
363366
"return_code": 0,
364367
"failure_reason": None,
365368
"summary_metrics": {"pages": 0, "ingest_secs": 1.0, "pages_per_sec_ingest": 0.0, "recall_5": None},
369+
"tags": tags,
366370
}
367371

368372
monkeypatch.setattr(harness_run, "_run_single", _fake_run_single)

0 commit comments

Comments
 (0)