: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(warehouse-sources): demote webhook template tests (#122584)
Paul D'Ambra97a14561c792
diff --git a/products/cdp/backend/templates/helpers.py b/products/cdp/backend/templates/helpers.pyindex 3a91cf5da480..118efc4dbc5d 100644--- a/products/cdp/backend/templates/helpers.py+++ b/products/cdp/backend/templates/helpers.py@@ -1,11 +1,13 @@import jsonimport functoolsfrom collections.abc import Callable-from typing import Any, Optional, cast+from typing import TYPE_CHECKING, Any, Optional, castfrom posthog.test.base import APIBaseTest, BaseTestfrom unittest.mock import MagicMock, patch+from django.test import SimpleTestCase+from posthog.models.utils import uuid7from products.cdp.backend.models.hog_functions.hog_function import HogFunction@@ -56,8 +58,14 @@ def mock_transpile(code: str, type: str = "site") -> str:return code+if TYPE_CHECKING:+ _MixinBase = SimpleTestCase+else:+ _MixinBase = object++# TODO this test class only tests part of the template. The hog code is tested, the default mappings are not-class BaseHogFunctionTemplateTest(BaseTest):+class BaseHogFunctionTemplateTestMixin(_MixinBase):template: HogFunctionTemplateDCcompiled_hog: Anymock_fetch = MagicMock()@@ -145,6 +153,14 @@ class BaseHogFunctionTemplateTest(BaseTest):)+class BaseHogFunctionTemplateTest(BaseHogFunctionTemplateTestMixin, BaseTest):+ pass+++class BaseHogFunctionTemplateSimpleTest(BaseHogFunctionTemplateTestMixin, SimpleTestCase):+ pass++class BaseSiteDestinationFunctionTest(APIBaseTest):template: HogFunctionTemplateDCtrack_fn: strdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.pyindex 37da3d44c2d8..44ac6e7d5414 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py@@ -1,10 +1,10 @@from parameterized import parameterized-from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTest+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateSimpleTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.default_webhook_template import template-class TestDefaultWarehouseWebhookTemplate(BaseHogFunctionTemplateTest):+class TestDefaultWarehouseWebhookTemplate(BaseHogFunctionTemplateSimpleTest):template = templatedef createHogGlobals(self, globals=None) -> dict:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.pyindex 81e3e640858e..834307a4b4b2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py@@ -5,13 +5,13 @@ import hashlibfrom parameterized import parameterized-from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTest+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateSimpleTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.customer_io.webhook_template import templateSOURCE_ID = "source_test_123"-class TestCustomerIOWarehouseWebhookTemplate(BaseHogFunctionTemplateTest):+class TestCustomerIOWarehouseWebhookTemplate(BaseHogFunctionTemplateSimpleTest):template = templatedef createHogGlobals(self, globals=None) -> dict:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.pyindex 1749268cd1e9..3ccfb34d3f09 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py@@ -5,7 +5,7 @@ import hashlibfrom parameterized import parameterized-from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTest+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateSimpleTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.fourthwall.webhook_template import templateSOURCE_ID = "source_test_123"@@ -13,7 +13,7 @@ SIGNING_SECRET = "e3f93c7c-c92b-4b8f-a9b1-5b70e0891abc"SCHEMA_MAPPING = {"order": "schema_orders", "donation": "schema_donations", "member": "schema_members"}-class TestFourthwallWarehouseWebhookTemplate(BaseHogFunctionTemplateTest):+class TestFourthwallWarehouseWebhookTemplate(BaseHogFunctionTemplateSimpleTest):template = templatedef createHogGlobals(self, globals=None) -> dict: