From 2f12505386bafcd43099311984985a1dfcc384ec Mon Sep 17 00:00:00 2001 From: GareArc Date: Wed, 11 Mar 2026 23:40:01 -0700 Subject: [PATCH] fix: export telemetry routing constants for tests Export CASE_ROUTING and CASE_TO_TRACE_TASK as module-level constants to fix import errors in enterprise telemetry tests. Tests were failing with: - ImportError: cannot import name 'CASE_ROUTING' from 'core.telemetry.gateway' - ImportError: cannot import name 'CASE_TO_TRACE_TASK' from 'core.telemetry.gateway' This fix allows tests to access the routing configuration without breaking the lazy-loading pattern used internally. --- api/core/telemetry/gateway.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/core/telemetry/gateway.py b/api/core/telemetry/gateway.py index b2b8d3d470..6d6b22e8e5 100644 --- a/api/core/telemetry/gateway.py +++ b/api/core/telemetry/gateway.py @@ -60,7 +60,6 @@ def get_trace_task_to_case() -> dict: """Return TraceTaskName → TelemetryCase (inverse of _get_case_to_trace_task).""" return {v: k for k, v in _get_case_to_trace_task().items()} - def _get_case_routing() -> dict: global _case_routing if _case_routing is None: @@ -87,6 +86,9 @@ def _get_case_routing() -> dict: } return _case_routing +# Public exports for tests and external consumers +CASE_TO_TRACE_TASK = _get_case_to_trace_task() +CASE_ROUTING = _get_case_routing() # --------------------------------------------------------------------------- # Helpers