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
4 changes: 1 addition & 3 deletions shared/db_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def _parse_quantum_summary() -> dict[str, Any]:
return {}


def log_quantum_run_safe(
job, result: dict[str, Any], dataset_name: str, log_path: str
) -> dict[str, Any]: # noqa: ANN001
def log_quantum_run_safe(job, result: dict[str, Any], dataset_name: str, log_path: str) -> dict[str, Any]: # noqa: ANN001
"""Best-effort quantum run logging; returns a skip/error dict on failure."""
conn = _get_conn()
if not conn:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_agent_mode_delegation_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def test_alias_sources_exist_as_alternate_mode_agent_names() -> None:
assert sources, "Expected alias source entries in alias section"
available = {n for n in (_extract_agent_name(p) for p in AGENTS_DIR.glob("*.agent.md")) if n}
missing_sources = sorted({s for s in sources if s not in available})
assert (
not missing_sources
), f"Alias source names should map to existing alternate-mode agent names: {missing_sources}"
assert not missing_sources, (
f"Alias source names should map to existing alternate-mode agent names: {missing_sources}"
)


@pytest.mark.unit
Expand Down
6 changes: 3 additions & 3 deletions tests/test_aria_auto_execute_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def test_auto_execute_settings_persistence_wiring_present() -> None:
assert "aria-autoexec-use-llm" in html, "Auto-execute should persist use-llm toggle"
assert "aria-autoexec-show-state" in html, "Auto-execute should persist show-state toggle"
assert "restoreAutoExecuteSettings()" in html, "Auto-execute should restore saved settings on load"
assert (
"persistAutoExecuteSettings(provider, model, useLlm, showState)" in html
), "Auto-execute should persist settings before requests"
assert "persistAutoExecuteSettings(provider, model, useLlm, showState)" in html, (
"Auto-execute should persist settings before requests"
)


def test_auto_execute_quantum_toolbar_and_presets() -> None:
Expand Down
24 changes: 12 additions & 12 deletions tests/test_aria_index_provider_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ def test_index_has_provider_and_model_controls() -> None:
def test_controller_reads_override_inputs() -> None:
js = CONTROLLER_JS.read_text(encoding="utf-8")

assert (
'getElementById("providerSelect")' in js or "getElementById('providerSelect')" in js
), "Controller should read provider selector"
assert (
'getElementById("modelInput")' in js or "getElementById('modelInput')" in js
), "Controller should read model/path input"
assert (
'getElementById("useLlmToggle")' in js or "getElementById('useLlmToggle')" in js
), "Controller should read LLM toggle"
assert 'getElementById("providerSelect")' in js or "getElementById('providerSelect')" in js, (
"Controller should read provider selector"
)
assert 'getElementById("modelInput")' in js or "getElementById('modelInput')" in js, (
"Controller should read model/path input"
)
assert 'getElementById("useLlmToggle")' in js or "getElementById('useLlmToggle')" in js, (
"Controller should read LLM toggle"
)


def test_controller_forwards_overrides_to_command_endpoint() -> None:
Expand All @@ -45,9 +45,9 @@ def test_controller_persists_provider_settings_in_localstorage() -> None:
assert "aria-model-input" in js, "Controller should persist model/path"
assert "aria-use-llm-toggle" in js, "Controller should persist use_llm toggle"
assert "restoreProviderSettings()" in js, "Controller should restore provider settings on load"
assert (
"persistProviderSettings(provider, model, useLlm)" in js
), "Controller should persist settings before requests"
assert "persistProviderSettings(provider, model, useLlm)" in js, (
"Controller should persist settings before requests"
)


def test_index_loads_stage_controller_and_threejs() -> None:
Expand Down
390 changes: 195 additions & 195 deletions tests/test_aria_server.py

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions tests/test_consolidated_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def test_card_not_inside_status_pills(self, html_text):
assert gpu_ready_pos != -1, "GPU Ready pill not found"

# The hyperopt container should come AFTER the GPU ready pill
assert (
card_pos > gpu_ready_pos
), "hyperoptContainer appears before/inside the status-pills header block; it should be in the Tools tab"
assert card_pos > gpu_ready_pos, (
"hyperoptContainer appears before/inside the status-pills header block; it should be in the Tools tab"
)

def test_card_near_anomaly_detector(self, html_text):
"""Hyperopt card should appear shortly after the Anomaly Detector card."""
Expand All @@ -94,9 +94,9 @@ def test_card_near_anomaly_detector(self, html_text):
assert hyperopt_pos != -1, "Hyperparameter Optimizer card not found"
assert hyperopt_pos > anomaly_pos, "Hyperparameter Optimizer card should come after Anomaly Detector"
# They should be reasonably close (within 2000 chars)
assert (
hyperopt_pos - anomaly_pos < 2000
), "Hyperparameter Optimizer card is suspiciously far from Anomaly Detector"
assert hyperopt_pos - anomaly_pos < 2000, (
"Hyperparameter Optimizer card is suspiciously far from Anomaly Detector"
)

def test_status_pills_has_three_pills(self, html_text):
"""Header status-pills block should contain exactly 3 .status-pill divs."""
Expand Down Expand Up @@ -152,9 +152,9 @@ def test_loadconfig_closes_before_hyperopt(self, html_lines):
# The closing brace line of loadConfig is exactly " }" (8 spaces + "}")
# Accept either 8-space or 12-space indent closing brace (depends on script tag indentation)
close_lines = [line for line in between if re.match(r"^(?: | )\}$", line)]
assert (
len(close_lines) >= 1
), "loadConfig() does not appear to close before startHyperparamOptimization — functions may still be nested"
assert len(close_lines) >= 1, (
"loadConfig() does not appear to close before startHyperparamOptimization — functions may still be nested"
)


# ---------------------------------------------------------------------------
Expand All @@ -179,9 +179,9 @@ def test_uses_safe_batch_size_key(self, html_text):

def test_handles_no_gpu(self, html_text):
"""There should be error/warning handling for the no-GPU response path."""
assert (
"data.error" in html_text or "data.available" in html_text
), "VRAM calculator should handle error/available=false from API"
assert "data.error" in html_text or "data.available" in html_text, (
"VRAM calculator should handle error/available=false from API"
)


# ---------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/test_orchestrator_health_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def test_orchestrator_health_aggregates_autonomous_training(app_module: ModuleTy
orchestrators = data["orchestrator_health"]["orchestrators"]

# If status file exists, should be included
assert (
"autonomous_training" in orchestrators
), "autonomous_training orchestrator missing despite status file present."
assert "autonomous_training" in orchestrators, (
"autonomous_training orchestrator missing despite status file present."
)
orch = orchestrators["autonomous_training"]
assert "status" in orch
assert "cycles_completed" in orch or "error" in orch
Expand Down
6 changes: 3 additions & 3 deletions tests/test_parallel_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def test_parallel_status_structure():
# diversity_avg must equal score
assert entry.get("diversity_avg") == entry.get("score"), "alias score mismatch"
if metric == "perplexity_improvement" and "perplexity_improvement" in entry:
assert (
pytest.approx(entry["perplexity_improvement"], rel=1e-3) == entry["score"]
), "improvement score mismatch"
assert pytest.approx(entry["perplexity_improvement"], rel=1e-3) == entry["score"], (
"improvement score mismatch"
)
18 changes: 9 additions & 9 deletions tests/test_training_analytics_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def test_training_analytics_report_pipe_head_with_pipefail_exits_zero() -> None:
timeout=30,
)

assert (
proc.returncode == 0
), f"expected zero exit with pipefail enabled, got {proc.returncode}; stderr={proc.stderr!r}"
assert proc.returncode == 0, (
f"expected zero exit with pipefail enabled, got {proc.returncode}; stderr={proc.stderr!r}"
)


@pytest.mark.unit
Expand Down Expand Up @@ -173,9 +173,9 @@ def test_training_analytics_chart_pipe_head_with_pipefail_exits_zero() -> None:
timeout=30,
)

assert (
proc.returncode == 0
), f"expected zero exit for chart mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}"
assert proc.returncode == 0, (
f"expected zero exit for chart mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}"
)


@pytest.mark.unit
Expand All @@ -194,6 +194,6 @@ def test_training_analytics_default_mode_pipe_head_with_pipefail_exits_zero() ->
timeout=30,
)

assert (
proc.returncode == 0
), f"expected zero exit for default mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}"
assert proc.returncode == 0, (
f"expected zero exit for default mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}"
)
6 changes: 3 additions & 3 deletions tests/test_ui_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def test_client_add_pickup_and_drag_updates_server():

# wait for server to report it
obj = wait_for_object(unique_name, timeout=5.0)
assert (
obj is not None
), f"Server didn't report new object {unique_name}: {requests.get(SERVER_URL + '/api/aria/state').text}"
assert obj is not None, (
f"Server didn't report new object {unique_name}: {requests.get(SERVER_URL + '/api/aria/state').text}"
)

# Now pick the object up using client function
page.evaluate("(name) => pickUpObject(name)", unique_name)
Expand Down
Loading