Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/benchmark-fastlanes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@ jobs:
from pathlib import Path

results = json.loads(Path(sys.argv[1]).read_text())
evidence = results.get("evidence", {})
evidence = results.get("evidence")
if evidence is None:
raise SystemExit(
"FastLanes claim "
f"{results.get('status', 'UNKNOWN')}: "
f"{results.get('failure_reason', 'no failure reason recorded')}"
)
if evidence.get("status") != "MEASURED":
raise SystemExit(f"FastLanes claim status: {evidence.get('status')}")
mixed = evidence.get("mixed", {})
Expand Down
22 changes: 20 additions & 2 deletions src/format_bench/claims/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from .fastlanes import run_fastlanes_claim
from .tsfile import run_tsfile_claim
from .vortex import run_vortex_stress

if TYPE_CHECKING:
from .tsfile import run_tsfile_claim
from .vortex import run_vortex_stress

__all__ = ["run_fastlanes_claim", "run_tsfile_claim", "run_vortex_stress"]


def __getattr__(name: str):
if name == "run_tsfile_claim":
from .tsfile import run_tsfile_claim

return run_tsfile_claim
if name == "run_vortex_stress":
from .vortex import run_vortex_stress

return run_vortex_stress
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
18 changes: 18 additions & 0 deletions tests/test_claims_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import subprocess
import sys


def test_fastlanes_claim_import_does_not_require_tsfile_dependencies() -> None:
code = """
import sys
sys.modules["pyarrow"] = None
from format_bench.claims.fastlanes import run_fastlanes_claim
assert callable(run_fastlanes_claim)
"""
completed = subprocess.run(
[sys.executable, "-c", code],
check=False,
capture_output=True,
text=True,
)
assert completed.returncode == 0, completed.stderr
1 change: 1 addition & 0 deletions tests/test_fastlanes_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ def test_fastlanes_retry_workflow_preserves_build_and_measurement_logs() -> None
assert '"status": "UNSUPPORTED" if not available else "FAILED"' in workflow
assert "case_hash_algorithm" in workflow
assert "input/data.csv" in workflow
assert "no failure reason recorded" in workflow
assert "if: always()" in workflow
Loading