forked from GareBear99/ARC-Neuron-LLMBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_execution_flow.py
More file actions
38 lines (26 loc) · 1.29 KB
/
Copy pathtest_execution_flow.py
File metadata and controls
38 lines (26 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def run(*parts: str, expect_ok: bool = True) -> dict:
proc = subprocess.run([sys.executable, *parts], cwd=ROOT, capture_output=True, text=True)
if expect_ok and proc.returncode != 0:
raise AssertionError(proc.stderr or proc.stdout)
return json.loads(proc.stdout)
def test_backend_check_runs_for_heuristic_smoke() -> None:
data = run("scripts/execution/check_local_backend.py", "--adapter", "heuristic")
assert data["health"]["ok"] is True
assert data["smoke"]["ok"] is True
def test_backend_check_rejects_heuristic_when_live_backend_required() -> None:
data = run("scripts/execution/check_local_backend.py", "--adapter", "heuristic", "--require-live-backend", expect_ok=False)
assert data["ok"] is False
def test_release_bundle_builds() -> None:
data = run("scripts/execution/generate_release_bundle.py")
assert data["ok"] is True
assert (ROOT / data["bundle"]).exists()
def test_model_card_generation_runs() -> None:
data = run("scripts/execution/generate_model_card.py", "--model-name", "heuristic_ci", "--adapter", "heuristic")
assert data["ok"] is True
assert (ROOT / data["model_card"]).exists()