MCPcopy
hub / github.com/tirth8205/code-review-graph / test_run_all_benchmarks

Function test_run_all_benchmarks

tests/test_eval.py:466–533  ·  view source on GitHub ↗

run_all_benchmarks returns results for all workflows.

()

Source from the content-addressed store, hash-verified

464
465
466def test_run_all_benchmarks():
467 """run_all_benchmarks returns results for all workflows."""
468 from code_review_graph.eval.token_benchmark import run_all_benchmarks
469
470 with tempfile.TemporaryDirectory() as tmpdir:
471 repo_path = Path(tmpdir) / "all_bench_repo"
472 repo_path.mkdir()
473
474 subprocess.run(
475 ["git", "init"], cwd=str(repo_path), capture_output=True,
476 )
477 subprocess.run(
478 ["git", "config", "user.email", "test@test.com"],
479 cwd=str(repo_path), capture_output=True,
480 )
481 subprocess.run(
482 ["git", "config", "user.name", "Test"],
483 cwd=str(repo_path), capture_output=True,
484 )
485
486 (repo_path / "app.py").write_text(
487 'def main():\n print("hello")\n',
488 encoding="utf-8",
489 )
490
491 subprocess.run(
492 ["git", "add", "."], cwd=str(repo_path), capture_output=True,
493 )
494 subprocess.run(
495 ["git", "commit", "-m", "initial"],
496 cwd=str(repo_path), capture_output=True,
497 )
498
499 (repo_path / "app.py").write_text(
500 'def main():\n print("hi")\n',
501 encoding="utf-8",
502 )
503 subprocess.run(
504 ["git", "add", "."], cwd=str(repo_path), capture_output=True,
505 )
506 subprocess.run(
507 ["git", "commit", "-m", "update"],
508 cwd=str(repo_path), capture_output=True,
509 )
510
511 from code_review_graph.graph import GraphStore
512 from code_review_graph.incremental import full_build, get_db_path
513
514 db_path = get_db_path(repo_path)
515 store = GraphStore(db_path)
516 full_build(repo_path, store)
517 store.close()
518
519 results = run_all_benchmarks(repo_root=str(repo_path), base="HEAD~1")
520
521 # Should have one result per workflow (5 total)
522 assert len(results) == 5
523

Callers

nothing calls this directly

Calls 5

closeMethod · 0.95
get_db_pathFunction · 0.90
GraphStoreClass · 0.90
full_buildFunction · 0.90
run_all_benchmarksFunction · 0.90

Tested by

no test coverage detected