mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the container entrypoint, so the misspelling does not degrade a feature -- it runs migrate --check against a database whose history this tree does not share and the container never starts. Both replacements are measured against the shipped tree rather than chosen: every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL -> INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12 determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_ tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of the bad rule and cannot collide with an upstream name. The rule is fixed for the next convergence, and the tree it already produced is repaired in the same commit -- the codemod is idempotent against its own output, so it cannot undo this itself.
26 lines
861 B
Python
26 lines
861 B
Python
"""Shared test fixtures for insightscli framework tests."""
|
|
|
|
import pytest
|
|
|
|
from insightscli import telemetry
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _opt_out_of_real_telemetry(monkeypatch):
|
|
# CliRunner tests otherwise run the live path against the developer's real
|
|
# ~/.config/insights config and POST real events with the committed api_key.
|
|
# Suites that exercise telemetry itself (test_telemetry.py) delete this var
|
|
# in their own fixture and substitute an isolated tmp config.
|
|
monkeypatch.setenv("INSIGHTS_TELEMETRY_OPT_OUT", "1")
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _clear_telemetry_state():
|
|
with telemetry._client._lock:
|
|
telemetry._client._queue.clear()
|
|
telemetry._client._inflight.clear()
|
|
yield
|
|
with telemetry._client._lock:
|
|
telemetry._client._queue.clear()
|
|
telemetry._client._inflight.clear()
|