test(stabilization): Resolve run_linear API drift and implement vlogger high-signal reporting
This commit is contained in:
@@ -5,13 +5,11 @@ import requests
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
from typing import Generator
|
||||
import os
|
||||
from typing import Generator, Any
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
import ai_client
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -22,6 +20,16 @@ def reset_ai_client() -> Generator[None, None, None]:
|
||||
ai_client.set_provider("gemini", "gemini-2.5-flash-lite")
|
||||
yield
|
||||
|
||||
class VisualLogger:
|
||||
def log_state(self, label: str, before: Any, after: Any) -> None:
|
||||
print(f"[STATE] {label}: {before} -> {after}")
|
||||
def finalize(self, title: str, status: str, result: str) -> None:
|
||||
print(f"[FINAL] {title}: {status} - {result}")
|
||||
|
||||
@pytest.fixture
|
||||
def vlogger() -> VisualLogger:
|
||||
return VisualLogger()
|
||||
|
||||
def kill_process_tree(pid: int | None) -> None:
|
||||
"""Robustly kills a process and all its children."""
|
||||
if pid is None:
|
||||
@@ -83,6 +91,7 @@ def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]:
|
||||
print(f"\n[Fixture] Finally block triggered: Shutting down {gui_script}...")
|
||||
# Reset the GUI state before shutting down
|
||||
try:
|
||||
from api_hook_client import ApiHookClient
|
||||
client = ApiHookClient()
|
||||
client.reset_session()
|
||||
time.sleep(0.5)
|
||||
|
||||
Reference in New Issue
Block a user