MCPcopy
hub / github.com/aiming-lab/AutoResearchClaw / test_pipeline_prints_elapsed_time

Function test_pipeline_prints_elapsed_time

tests/test_rc_runner.py:457–494  ·  view source on GitHub ↗
(
    monkeypatch: pytest.MonkeyPatch,
    run_dir: Path,
    rc_config: RCConfig,
    adapters: AdapterBundle,
    capsys: pytest.CaptureFixture[str],
)

Source from the content-addressed store, hash-verified

455
456
457def test_pipeline_prints_elapsed_time(
458 monkeypatch: pytest.MonkeyPatch,
459 run_dir: Path,
460 rc_config: RCConfig,
461 adapters: AdapterBundle,
462 capsys: pytest.CaptureFixture[str],
463) -> None:
464 mock_result = StageResult(
465 stage=Stage.TOPIC_INIT,
466 status=StageStatus.DONE,
467 artifacts=("topic.json",),
468 )
469 mock_fail = StageResult(
470 stage=Stage.PROBLEM_DECOMPOSE,
471 status=StageStatus.FAILED,
472 artifacts=(),
473 error="test",
474 )
475 results_iter = iter([mock_result, mock_fail])
476
477 monkeypatch.setattr(
478 rc_runner, "execute_stage", lambda *args, **kwargs: next(results_iter)
479 )
480 monkeypatch.setattr(rc_runner, "write_stage_to_kb", lambda *args, **kwargs: [])
481
482 _ = rc_runner.execute_pipeline(
483 run_dir=run_dir,
484 run_id="rc-test-002",
485 config=rc_config,
486 adapters=adapters,
487 )
488
489 captured = capsys.readouterr()
490 import re
491
492 assert re.search(r"\d+\.\d+s\)", captured.out), (
493 f"No elapsed time found in: {captured.out}"
494 )
495
496
497# ── PIVOT/PROCEED/REFINE decision loop tests ──

Callers

nothing calls this directly

Calls 2

StageResultClass · 0.85
searchMethod · 0.45

Tested by

no test coverage detected