run_all_benchmarks returns results for all workflows.
()
| 464 | |
| 465 | |
| 466 | def 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 |
nothing calls this directly
no test coverage detected