feat(phase-8): implement operational web dashboard, rest api, and telemetry data provider

This commit is contained in:
2026-10-21 13:14:00 +05:30
parent 630855252b
commit be37f15432
15 changed files with 2770 additions and 15 deletions
+27
View File
@@ -0,0 +1,27 @@
"""Unit tests verifying that dashboard dependencies remain strictly optional."""
from __future__ import annotations
import pytest
from warehouse_twin.dashboard.data_provider import DashboardDataProvider
from warehouse_twin.dashboard.streamlit_app import HAS_STREAMLIT, run_streamlit_app
def test_dashboard_operates_without_streamlit():
"""Verify that DashboardDataProvider and server function independently of Streamlit."""
dp = DashboardDataProvider()
assert dp is not None
# Data provider does not import streamlit
assert hasattr(dp, "list_experiments")
def test_streamlit_app_handles_missing_dependency():
"""Verify that streamlit_app module handles missing streamlit cleanly."""
if not HAS_STREAMLIT:
# Calling run_streamlit_app without streamlit should exit cleanly or print error
with pytest.raises(SystemExit) as exc:
run_streamlit_app()
assert exc.value.code == 1
else:
assert HAS_STREAMLIT is True