:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(hogai): take the redis stream tests off the database (#99784)
posthog[bot]ebe9c197b6a9
diff --git a/ee/hogai/stream/test/test_redis_stream.py b/ee/hogai/stream/test/test_redis_stream.pyindex a6c376b88d18..17b91578d10c 100644--- a/ee/hogai/stream/test/test_redis_stream.py+++ b/ee/hogai/stream/test/test_redis_stream.py@@ -47,7 +47,7 @@ from ee.hogai.stream.redis_stream import (from ee.hogai.utils.types.base import ApprovalPayload, AssistantOutput-class TestRedisStream(BaseTest):+class TestRedisStream(SimpleTestCase):def setUp(self):self.stream_key = f"test_stream:{uuid4()}"self.redis_stream = ConversationRedisStream(self.stream_key)@@ -567,21 +567,6 @@ class TestRedisStream(BaseTest):data = call[0][1]self.assertIn("data", data)- def test_serializer_conversation_serialization(self):- serializer = ConversationStreamSerializer()- conversation = Conversation.objects.create(team=self.team, user=self.user)- event: AssistantOutput = (AssistantEventType.CONVERSATION, conversation)- serialized = serializer.dumps(event)- self.assertIsNotNone(serialized)- serialized = cast(dict[str, bytes], serialized)- self.assertIn("data", serialized)- self.assertIsInstance(serialized["data"], bytes)-- bytes_data = {bytes(k, "utf-8"): v for k, v in serialized.items()}- deserialized = serializer.deserialize(bytes_data)- self.assertEqual(deserialized.event.type, AssistantEventType.CONVERSATION)- self.assertEqual(deserialized.event.payload, conversation.id)-def test_serializer_status_serialization(self):# Test RedisStreamSerializer with status dataserializer = ConversationStreamSerializer()@@ -635,7 +620,24 @@ class TestRedisStream(BaseTest):self.assertIn("Unknown event type", str(context.exception))-class TestGetSubagentStreamKey(BaseTest):+class TestConversationEventSerialization(BaseTest):+ def test_serializer_conversation_serialization(self):+ serializer = ConversationStreamSerializer()+ conversation = Conversation.objects.create(team=self.team, user=self.user)+ event: AssistantOutput = (AssistantEventType.CONVERSATION, conversation)+ serialized = serializer.dumps(event)+ self.assertIsNotNone(serialized)+ serialized = cast(dict[str, bytes], serialized)+ self.assertIn("data", serialized)+ self.assertIsInstance(serialized["data"], bytes)++ bytes_data = {bytes(k, "utf-8"): v for k, v in serialized.items()}+ deserialized = serializer.deserialize(bytes_data)+ self.assertEqual(deserialized.event.type, AssistantEventType.CONVERSATION)+ self.assertEqual(deserialized.event.payload, conversation.id)+++class TestGetSubagentStreamKey(SimpleTestCase):def test_get_subagent_stream_key_format(self):conversation_id = uuid4()tool_call_id = "tool_123"diff --git a/posthog/test/repo_invariants/database_free_test_classes_baseline.txt b/posthog/test/repo_invariants/database_free_test_classes_baseline.txtindex e98c0a3c3dc4..5649b5221f52 100644--- a/posthog/test/repo_invariants/database_free_test_classes_baseline.txt+++ b/posthog/test/repo_invariants/database_free_test_classes_baseline.txt@@ -45,7 +45,6 @@ ee/hogai/core/test/test_artifacts.py::TestVisualizationArtifactContentee/hogai/core/test/test_base_callback_handlers.py::TestSubagentCallbackHandleree/hogai/core/test/test_dispatcher_integration.py::TestDispatcherIntegrationee/hogai/research_agent/test/test_runner.py::TestResearchAgentRunnerConfiguration-ee/hogai/stream/test/test_redis_stream.py::TestGetSubagentStreamKeyee/hogai/summarizers/test/test_property_filters.py::TestPropertyFilterCollectionDescriberee/hogai/summarizers/test/test_property_filters.py::TestPropertyFilterDescriberee/hogai/test/test_registry.py::TestToolRegistry